Adding "Open with Cursor" to the Windows Context Menu – Problem Solved!

Hey everyone, this is my first post on this forum.

So, I downloaded Cursor today and absolutely loved it. It’s got some amazing features and definitely deserves a spot in my daily toolkit. But then I noticed something that bugged me – I couldn’t open directories with Cursor directly from the context menu like I can with VSCode. I could not live without this feature from my main IDE, so I had to do something about it. This also seemed like a great contribution for this community, and I wanted to make it as easy as possible to download for anyone who wants this feature.

I created a little utility that adds a shiny new “Open with Cursor” option to your right-click context menu in Windows Explorer when you right click on empty space within directories:
image
Ignore the icon, which is either due to me not restarting my PC (apparently some regedit context menu updates only display after you do that) or some other issue I cba’d to finish. You can also set a custom ico as your image, but you’ll have to adjust the source a bit. Note that this only works for selections on empty space within directories, and would need to be expanded upon to also support context menus that appear when you right click a directory. As you see, you can just click that context menu item to open the directory with Cursor as you would with VSCode.

How You Can Get It

Just head over to my GitHub repo here and grab the latest release. Run install.exe to add the context menu item. If you ever want to remove it, just run uninstall.exe – easy peasy. All of the code is public and you can compile it on your own if you don’t want to download my provided executables.

How it Works

This program provides a way to add and remove a context menu item in Windows Explorer for opening directories with the Cursor application. The install.cpp file checks for elevated privileges and, if necessary, re-runs itself as an administrator before creating registry keys to add the context menu item. The uninstall.cpp file deletes the registry keys to remove the context menu item. The installation process uses a default path for the Cursor executable but allows for a custom path via command-line arguments. Compilation instructions are provided in the README.md file, which also includes usage instructions for downloading and running the executables. The program uses Windows API functions to interact with the registry and manage process elevation.

Future Improvements

I’ll leave this to the community or future me to tackle:

  1. Ensuring the icon is 100% right - it might be, but it might not be.
  2. Adding support for context menus that appear when a directory name is clicked.
  3. Figuring out other ways to make it better.

Final Note

I hope you guys enjoy this little tool. I am happy to contribute to this wonderful community for this amazing IDE. Thank you for reading and I hope this improves your life, even by just a tad!

3 Likes

This is huge.!! You just used a Cursor and solved a problem?
I will install this util, I think it’s an easy way to start a project with Cursor.
Well done Bro.

1 Like

image
Now the icon displays properly :slight_smile:

Appreciate all the excellent engineers on this forum who create tools to make other engineers’ lives easier. We are so lucky to live in this world.

Great job Hex! I built a powershell script for that and it is open source:

2 Likes

thanks has also add reg method, download this bat and double click run

check Cursor.exe abs path is:
“C:\Users*username*\AppData\Local\Programs\Cursor\Cursor.exe”

raw.githubusercontent.com/eatcosmos/cursor_ext_open-with-cursor-context-menu/main/cursorOpenFolder.bat

1 Like