Visual Studio Code "Open With Code" does not appear after right-clicking a folder

Windows 7Visual Studio-CodeWindows 7-X64

Windows 7 Problem Overview


Just installed Visual Studio Code 1.1.1 on a Windows 7 machine. When I right-click on a folder, "Open With Code" does not appear.

enter image description here

Windows 7 Solutions


Solution 1 - Windows 7

Copied from Right click on Windows folder and open with Visual Studio Code

  • Create file vsCodeOpenFolder.reg with this content (If you didn't choose the default installation path then you need to adjust the paths in this file):

     Windows Registry Editor Version 5.00
     ; Open files
     [HKEY_CLASSES_ROOT\*\shell\Open with VS Code]
     @="Edit with VS Code"
     "Icon"="C:\\Program Files (x86)\\Microsoft VS Code\\Code.exe,0"
     [HKEY_CLASSES_ROOT\*\shell\Open with VS Code\command]
     @="\"C:\\Program Files (x86)\\Microsoft VS Code\\Code.exe\" \"%1\""
     ; This will make it appear when you right click ON a folder
     ; The "Icon" line can be removed if you don't want the icon to appear
     [HKEY_CLASSES_ROOT\Directory\shell\vscode]
     @="Open Folder as VS Code Project"
     "Icon"="\"C:\\Program Files (x86)\\Microsoft VS Code\\Code.exe\",0"
     [HKEY_CLASSES_ROOT\Directory\shell\vscode\command]
     @="\"C:\\Program Files (x86)\\Microsoft VS Code\\Code.exe\" \"%1\""
     ; This will make it appear when you right click INSIDE a folder
     ; The "Icon" line can be removed if you don't want the icon to appear
     [HKEY_CLASSES_ROOT\Directory\Background\shell\vscode]
     @="Open Folder as VS Code Project"
     "Icon"="\"C:\\Program Files (x86)\\Microsoft VS Code\\Code.exe\",0"
     [HKEY_CLASSES_ROOT\Directory\Background\shell\vscode\command]
     @="\"C:\\Program Files (x86)\\Microsoft VS Code\\Code.exe\" \"%V\""
    
  • Double click it to create the registry entries.

  • If the "Open with Code" doesn't appear in the Explorer's context menu then you should restart your system.

  • If you're running the 64-bit or Insiders version of VS Code, change the path accordingly.

Solution 2 - Windows 7

When installing (or reinstall and) check all checkBoxes especially:

> Add "Open with Code" action to Windows Explorer file context menu
> Add "Open with Code" action to Windows Explorer directory context menu

install vscode

I hope this helps.

Solution 3 - Windows 7

Here comes the version of file provided by Cockney Rhyming Jedi before suitable for use with 64-bit version of Visual Studio Code:

Windows Registry Editor Version 5.00
; Open files
[HKEY_CURRENT_USER\Software\Classes\*\shell\Open with VS Code]
@="Edit with VS Code"
"Icon"="C:\\Program Files\\Microsoft VS Code\\Code.exe,0"
[HKEY_CURRENT_USER\Software\Classes\*\shell\Open with VS Code\command]
@="\"C:\\Program Files\\Microsoft VS Code\\Code.exe\" \"%1\""
; This will make it appear when you right click ON a folder
; The "Icon" line can be removed if you don't want the icon to appear
[HKEY_CURRENT_USER\Software\Classes\Directory\shell\vscode]
@="Open Folder as VS Code Project"
"Icon"="\"C:\\Program Files\\Microsoft VS Code\\Code.exe\",0"
[HKEY_CURRENT_USER\Software\Classes\Directory\shell\vscode\command]
@="\"C:\\Program Files\\Microsoft VS Code\\Code.exe\" \"%1\""
; This will make it appear when you right click INSIDE a folder
; The "Icon" line can be removed if you don't want the icon to appear
[HKEY_CURRENT_USER\Software\Classes\Directory\Background\shell\vscode]
@="Open Folder as VS Code Project"
"Icon"="\"C:\\Program Files\\Microsoft VS Code\\Code.exe\",0"
[HKEY_CURRENT_USER\Software\Classes\Directory\Background\shell\vscode\command]
@="\"C:\\Program Files\\Microsoft VS Code\\Code.exe\" \"%V\""

Solution 4 - Windows 7

I'd like to add that, many would like to go for the Registry method because they are afraid they might loose all their settings. Just re-download(if you don't already have the download file ) and reinstall. When reinstalling, tick

Add "Open with Code" action to Windows Explorer file context menu
Add "Open with Code" action to Windows Explorer directory context menu

as already said in other answers. Your settings will remain intact. In fact, when it launches, it launches with your working directory as if you never uninstalled it.

Solution 5 - Windows 7

NB: This is for the 32-bit version, for the 64-bit version see Cepharum's answer.

Slight change to the previous answer to allow non Admins to get the functionality in their context menus:

  • Create file vsCodeOpenFolder.reg with this content (If you didn't chose the default installation path then you need to adjust the paths in this file):

     Windows Registry Editor Version 5.00
     ; Open files
     [HKEY_CURRENT_USER\Software\Classes\*\shell\Open with VS Code]
     @="Edit with VS Code"
     "Icon"="C:\\Program Files (x86)\\Microsoft VS Code\\Code.exe,0"
     [HKEY_CURRENT_USER\Software\Classes\*\shell\Open with VS Code\command]
     @="\"C:\\Program Files (x86)\\Microsoft VS Code\\Code.exe\" \"%1\""
     ; This will make it appear when you right click ON a folder
     ; The "Icon" line can be removed if you don't want the icon to appear
     [HKEY_CURRENT_USER\Software\Classes\Directory\shell\vscode]
     @="Open Folder as VS Code Project"
     "Icon"="\"C:\\Program Files (x86)\\Microsoft VS Code\\Code.exe\",0"
     [HKEY_CURRENT_USER\Software\Classes\Directory\shell\vscode\command]
     @="\"C:\\Program Files (x86)\\Microsoft VS Code\\Code.exe\" \"%1\""
     ; This will make it appear when you right click INSIDE a folder
     ; The "Icon" line can be removed if you don't want the icon to appear
     [HKEY_CURRENT_USER\Software\Classes\Directory\Background\shell\vscode]
     @="Open Folder as VS Code Project"
     "Icon"="\"C:\\Program Files (x86)\\Microsoft VS Code\\Code.exe\",0
     [HKEY_CURRENT_USER\Software\Classes\Directory\Background\shell\vscode\command]
     @="\"C:\\Program Files (x86)\\Microsoft VS Code\\Code.exe\" \"%V\""
    
  • Double click it to create the registry entries

  • If the "Open with Code" doesn't appear in the Explorer's context menu then you should restart your system.

Essentially I have replaced HKEY_CLASSES_ROOT with HKEY_CURRENT_USER\Software\Classes

Solution 6 - Windows 7

These settings are normally stored per-user for VS Code.

To set for a new user account: re-run the installer.

Solution 7 - Windows 7

If you have vscode installed already and you want the "open with code" option.

Just download vscode from the official website... [here](https://code.visualstudio.com/ "this text appears when you mouse over")!

Run the installer with the option "open with code" checked.

It will update the existing vscode install with the "open with code" option.

Solution 8 - Windows 7

None of the registry entries above worked for me with a standard (non-admin) user account.

I then inserted all the keys into HKEY_LOCAL_MACHINE and then it worked!

Windows Registry Editor Version 5.00

; when you right click a file
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\*\shell\VSCode]
@="Open with Code"
"Icon"="C:\\Program Files\\Microsoft VS Code\\Code.exe,0"

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\*\shell\VSCode\command]
@="\"C:\\Program Files\\Microsoft VS Code\\Code.exe\" \"%1\""

; when you right click a folder
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Directory\shell\VSCode]
@="Open Folder in Code"
"Icon"="C:\\Program Files\\Microsoft VS Code\\Code.exe,0"

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Directory\shell\VSCode\command]
@="\"C:\\Program Files\\Microsoft VS Code\\Code.exe\" \"%1\""

; when you right click a folder while holding shift
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Directory\Background\shell\VSCode]
@="Open Folder in Code"
"Icon"="C:\\Program Files\\Microsoft VS Code\\Code.exe,0"

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Directory\Background\shell\VSCode\command]
@="\"C:\\Program Files\\Microsoft VS Code\\Code.exe\" \"%V\""

; when you right click the background, not on a particular file or folder.
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\LibraryFolder\Background\shell\VSCode]
@="Open Folder in Code"
"Icon"="C:\\Program Files\\Microsoft VS Code\\Code.exe,0"

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\LibraryFolder\Background\shell\VSCode\command]
@="\"C:\\Program Files\\Microsoft VS Code\\Code.exe\" \"%V\""

Solution 9 - Windows 7

my vscode installed here:

C:\Users\saber\AppData\Local\Programs\Microsoft VS Code\code.exe

should replace SABER with your pc username

enter image description here

so the script is s.th like this:

save this content as a *.reg file

then run it :

Windows Registry Editor Version 5.00

; Open files
[HKEY_CLASSES_ROOT\*\shell\Open with VS Code]
@="Edit with VS Code"
"Icon"="C:\\Users\\saber\\AppData\\Local\\Programs\\Microsoft VS Code\\Code.exe,0"
[HKEY_CLASSES_ROOT\*\shell\Open with VS Code\command]
@="\"C:\\Users\\saber\\AppData\\Local\\Programs\\Microsoft VS Code\\Code.exe\" \"%1\""
; This will make it appear when you right click ON a folder
; The "Icon" line can be removed if you don't want the icon to appear
[HKEY_CLASSES_ROOT\Directory\shell\vscode]
@="Open Folder as VS Code Project"
"Icon"="\"C:\\Users\\saber\\AppData\\Local\\Programs\\Microsoft VS Code\\Code.exe\",0"
[HKEY_CLASSES_ROOT\Directory\shell\vscode\command]
@="\"C:\\Users\\saber\\AppData\\Local\\Programs\\Microsoft VS Code\\Code.exe\" \"%1\""
; This will make it appear when you right click INSIDE a folder
; The "Icon" line can be removed if you don't want the icon to appear
[HKEY_CLASSES_ROOT\Directory\Background\shell\vscode]
@="Open Folder as VS Code Project"
"Icon"="\"C:\\Users\\saber\\AppData\\Local\\Programs\\Microsoft VS Code\\Code.exe\",0"
[HKEY_CLASSES_ROOT\Directory\Background\shell\vscode\command]
@="\"C:\\Users\\saber\\AppData\\Local\\Programs\\Microsoft VS Code\\Code.exe\" \"%V\""

add visual studio code to right click folder in windows

replace the \\saber\\ with \\YOUR_PC_USER_NAME\\

Solution 10 - Windows 7

In my case, I just re-run the vscode setup and marked all checkboxes as checked and It worked.enter image description here

Solution 11 - Windows 7

Just run the installer again with open in file explorer option selected. You'll be all set.

Don't worry about the files already opened in vsCode, none of them will be changed

Solution 12 - Windows 7

If you prefer using the keyboard more than the mouse. This solution is for you...

Type the following commands in your file explorer (location).

Open a project

vscode://file/{full path to project}/

vscode://file/c:/myProject/

vscode:// --opens vscode for current directory

Open a file

vscode://file/{full path to file}

vscode://file/c:/myProject/package.json

Open a file to line and column

vscode://file/{full path to file}:line:column

vscode://file/c:/myProject/package.json:5:10

Source: https://code.visualstudio.com/docs/editor/command-line

Example:

enter image description here

Solution 13 - Windows 7

> I used 64bit VS Code installer

> copy and paste this codes into your pc notepad

> save as vscode.reg

> then open and merge that saved file. happy coding.

Windows Registry Editor Version 5.00
; Open files

[HKEY_CLASSES_ROOT\*\shell\Open with VS Code]
@="Edit with VS Code"
"Icon"="C:\\Program Files\\Microsoft VS Code\\Code.exe,0"

[HKEY_CLASSES_ROOT\*\shell\Open with VS Code\command]
@="\"C:\\Program Files\\Microsoft VS Code\\Code.exe\" \"%1\""


; This will handle right clicking on a folder and open that folder
; as a new project

[HKEY_CLASSES_ROOT\Directory\shell\vscode]
@="Open Folder as VS Code Project"
"Icon"="\"C:\\Program Files\\Microsoft VS Code\\Code.exe\",0"

[HKEY_CLASSES_ROOT\Directory\shell\vscode\command]
@="\"C:\\Program Files\\Microsoft VS Code\\Code.exe\" \"%1\""

; This handles the case of right clicking inside of a folder
; to open that folder as a new project

[HKEY_CLASSES_ROOT\Directory\Background\shell\vscode]
@="Open Folder as VS Code Project"
"Icon"="\"C:\\Program Files\\Microsoft VS Code\\Code.exe\",0"

[HKEY_CLASSES_ROOT\Directory\Background\shell\vscode\command]
@="\"C:\\Program Files\\Microsoft VS Code\\Code.exe\" \"%V\""

Solution 14 - Windows 7

Paste the code below and save with .reg extension

Windows Registry Editor Version 5.00 ; Open files

[HKEY_CURRENT_USER\Software\Classes\*\shell\Open with VS Code] @="Edit with VS Code" 

"Icon"="C:\Users\hp\AppData\Local\Programs\Microsoft VS Code\Code.exe,0" 

[HKEY_CURRENT_USER\Software\Classes\*\shell\Open with VS Code\command] 

@="\"C:\Users\hp\AppData\Local\Programs\Microsoft VS Code\Code.exe" \"%1\"" 
; This will make it appear when you right click ON a folder 

; The "Icon" line can be removed if you don't want the icon to appear

[HKEY_CURRENT_USER\Software\Classes\Directory\shell\vscode] 
@="Open Folder as VS Code Project"

"Icon"="\"C:\Users\hp\AppData\Local\Programs\Microsoft VS Code\Code.exe",0"

[HKEY_CURRENT_USER\Software\Classes\Directory\shell\vscode\command]

@="\"C:\Users\hp\AppData\Local\Programs\Microsoft VS Code\Code.exe" \"%1\"" 

; This will make it appear when you right click INSIDE a folder ; The "Icon" line can be removed if you don't want the icon to appear

[HKEY_CURRENT_USER\Software\Classes\Directory\Background\shell\vscode]

@="Open Folder as VS Code Project"

"Icon"="\"C:\Users\hp\AppData\Local\Programs\Microsoft VS Code\Code.exe",0

[HKEY_CURRENT_USER\Software\Classes\Directory\Background\shell\vscode\command]

@="\"C:\Users\hp\AppData\Local\Programs\Microsoft VS Code\Code.exe" \"%V\""

Then press the Windows key, locate Visual Studio Code, then right click and open file the location:

open vscode location

Right click and click Properties, then copy the file path.

enter image description here

Open regedit:

reg edit

For each of the following, double click on the icon, and paste the file path you copied from above:

[HKEY_CURRENT_USER\Software\Classes\*\shell\Open with VS Code]
[HKEY_CURRENT_USER\Software\Classes\*\shell\Open with VS Code\command]
[HKEY_CURRENT_USER\Software\Classes\Directory\shell\vscode]
[HKEY_CURRENT_USER\Software\Classes\Directory\shell\vscode\command]
[HKEY_CURRENT_USER\Software\Classes\Directory\Background\shell\vscode]
[HKEY_CURRENT_USER\Software\Classes\Directory\Background\shell\vscode\command]

enter image description here

Solution 15 - Windows 7

I had the same issue with earlier version of VS code 64 bit. It didn't work even after I re-installed by checking the above mentioned options.

I have installed the latest update of code v1.25.0, and the issue was automatically fixed.

vs code version

Please find the 64 bit regedit fix here.

Solution 16 - Windows 7

Just re run the installer and select the options in the setup and let it install. You'll not loose any data. Everything will be still intact as it was before. It just adds the missing settings and updates the path.

Solution 17 - Windows 7

try to find out the Microsoft vs Code files it is some time in the default location and sometimes it is in C:\Users\PAPPU KUMAR\AppData\Local\Programs\Microsoft VS Code.

and then add it to the vscode.reg(create one) files.

Windows Registry Editor Version 5.00

; Open files
[HKEY_CLASSES_ROOT\*\shell\Open with VS Code]
@="Edit with VS Code"
"Icon"="C:\\Users\\PAPPU KUMAR\\AppData\\Local\\Programs\\Microsoft VS Code\\Code.exe,0"
[HKEY_CLASSES_ROOT\*\shell\Open with VS Code\command]
@="\"C:\\Users\\PAPPU KUMAR\\AppData\\Local\\Programs\\Microsoft VS Code\\Code.exe\" \"%1\""
; This will make it appear when you right click ON a folder
; The "Icon" line can be removed if you don't want the icon to appear
[HKEY_CLASSES_ROOT\Directory\shell\vscode]
@="Open Folder as VS Code Project"
"Icon"="\"C:\\Users\\PAPPU KUMAR\\AppData\\Local\\Programs\\Microsoft VS Code\\Code.exe\",0"
[HKEY_CLASSES_ROOT\Directory\shell\vscode\command]
@="\"C:\\Users\\PAPPU KUMAR\\AppData\\Local\\Programs\\Microsoft VS Code\\Code.exe\" \"%1\""
; This will make it appear when you right click INSIDE a folder
; The "Icon" line can be removed if you don't want the icon to appear
[HKEY_CLASSES_ROOT\Directory\Background\shell\vscode]
@="Open Folder as VS Code Project"
"Icon"="\"C:\\Users\\PAPPU KUMAR\\AppData\\Local\\Programs\\Microsoft VS Code\\Code.exe\",0"
[HKEY_CLASSES_ROOT\Directory\Background\shell\vscode\command]
@="\"C:\\Users\\PAPPU KUMAR\\AppData\\Local\\Programs\\Microsoft VS Code\\Code.exe\" \"%V\""

Solution 18 - Windows 7

This problem usually occurs when the vs code user has standard user role. On VS Code installation admin prompt pops up which means that vs code is installed as admin user. If you ticked the boxes, the shortcuts are added but applied only on admin account which was typed into admin prompt on installation.

Quick workaround is to temporary add the current user (who will use the vs code) to administrators group, uninstall and then install VS Code again with the current user admin rights, and after installation remove the user from the admin group.

Solution 19 - Windows 7

Follow this Steps You will Definitely , Get - Open With Code in Explorer.

Why you are not getting this ,because You Didn't Add that to visual studio code while you install , backup Your Projects, if you have, hen just follow this steps For Windows User:

  1. Uninstall Visual Studio Code From. Control Panel\Programs\Programs and Features : image

  2. Reinstall Visual studio : here You Get/Download : https://code.visualstudio.com/download

  3. While install , Stop at Select Additional Tasks, Tick open with options - 2 boxes which is available at install process, complete your installation : image

  4. It's Done , check at explorer. You will find that in explorer : image

You Can Also , Try other methods, registry Editor - that's complicated -

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionDerekView Question on Stackoverflow
Solution 1 - Windows 7WosiView Answer on Stackoverflow
Solution 2 - Windows 7wasmupView Answer on Stackoverflow
Solution 3 - Windows 7Thomas UrbanView Answer on Stackoverflow
Solution 4 - Windows 7Alf MohView Answer on Stackoverflow
Solution 5 - Windows 7Cockney Rhyming JediView Answer on Stackoverflow
Solution 6 - Windows 7RichardView Answer on Stackoverflow
Solution 7 - Windows 7Aditya PatnaikView Answer on Stackoverflow
Solution 8 - Windows 7XpleriaView Answer on Stackoverflow
Solution 9 - Windows 7saber tabatabaee yazdiView Answer on Stackoverflow
Solution 10 - Windows 7AnalystView Answer on Stackoverflow
Solution 11 - Windows 7Rama Krishna ReddyView Answer on Stackoverflow
Solution 12 - Windows 7sudonitinView Answer on Stackoverflow
Solution 13 - Windows 7Mahinthan177View Answer on Stackoverflow
Solution 14 - Windows 7pr0f3ss0rView Answer on Stackoverflow
Solution 15 - Windows 7Ravikumar BView Answer on Stackoverflow
Solution 16 - Windows 7Mohammed FarmaanView Answer on Stackoverflow
Solution 17 - Windows 7Pappu Kumar PashiView Answer on Stackoverflow
Solution 18 - Windows 7Circus RangerView Answer on Stackoverflow
Solution 19 - Windows 7Gajangi SagarView Answer on Stackoverflow