Visual Studio Code (VS Code) adds the “Open with Code” option in your context menu. However, when you install the app via the Microsoft Store, the context menu option may be missing.
You may wonder how to add the “Open with Code” option to the right-click menu.
Resolution
To restore the missing “Open with Code” context menu, follow one of the methods below:
Method 1: Re-run the VS Code Setup program
First, uninstall the existing installation of VS Code. You can uninstall it via Apps & Features in Settings.
Then, download the non-store version of VS Code from the following link:
https://code.visualstudio.com/download# https://code.visualstudio.com/sha/download?build=stable&os=win32-x64 [Direct download link]
After downloading the VS Code setup program, run it.
Enable the two options: Add “Open with code” action to Windows Explorer file context menu and Add “Open with code” action to Windows Explorer directory context menu in the setup wizard.
Click Next, and click Install to complete the process.
Right-clicking a directory or file should now bring up the “Open with Code” context menu.
Method 2: Add “Open with Code” Using a Registry Edit
This method is preferred if you don’t want to reinstall Visual Studio Code.
To add “Open with Code” to the right-click menu for files/directory/directory background/drive, download add-vscode-context-menu.reg (zipped). Unzip the file and run the enclosed REG file.
INFO: Registry file contents
The above registry fix has the following contents:
Windows Registry Editor Version 5.00 ; Add "Open with Code" to the context menu for files/directory/directory background/drive. [HKEY_CLASSES_ROOT\*\shell\VSCode] "Icon"="C:\\Program Files\\Microsoft VS Code\\Code.exe" @="Open w&ith Code" [HKEY_CLASSES_ROOT\*\shell\VSCode\command] @="\"C:\\Program Files\\Microsoft VS Code\\Code.exe\" \"%1\"" [HKEY_CLASSES_ROOT\Directory\shell\VSCode] @="Open w&ith Code" "Icon"="C:\\Program Files\\Microsoft VS Code\\Code.exe" [HKEY_CLASSES_ROOT\Directory\shell\VSCode\command] @="\"C:\\Program Files\\Microsoft VS Code\\Code.exe\" \"%V\"" [HKEY_CLASSES_ROOT\Directory\Background\shell\VSCode] @="Open w&ith Code" "Icon"="C:\\Program Files\\Microsoft VS Code\\Code.exe" [HKEY_CLASSES_ROOT\Directory\Background\shell\VSCode\command] @="\"C:\\Program Files\\Microsoft VS Code\\Code.exe\" \"%V\"" [HKEY_CLASSES_ROOT\Drive\shell\VSCode] @="Open w&ith Code" "Icon"="C:\\Program Files\\Microsoft VS Code\\Code.exe" [HKEY_CLASSES_ROOT\Drive\shell\VSCode\command] @="\"C:\\Program Files\\Microsoft VS Code\\Code.exe\" \"%V\""
As you can see, the VS Code path in the REG file is hard-coded for “C:\Program Files\Microsoft VS Code\Code.exe”, which is the default installation path.
I hope you found the above methods helpful.
One small request: If you liked this post, please share this?
One "tiny" share from you would seriously help a lot with the growth of this blog. Some great suggestions:- Pin it!
- Share it to your favorite blog + Facebook, Reddit
- Tweet it!