Add Visual Studio Code to context menu in Windows


By this I mean when you right click on a file or folder, there’s an option in context menu to open it with mentioned editor. To do that, we’ll add couple of keys to Windows registry.

  1. Oepn regedit.exe

  2. Search for HKEY_CLASSES_ROOT\*\shell

  3. There create a new key by right-clicking on shell, select Key and name it Open with VSC (the name doesn’t really matter since it won’t be used for display in context menu, see the next step)

  4. Click on newly created key and on the right side double-click/edit the first entry, named (Default) and set the value to what you want to be the name of command in context menu.

  5. Add another entry by right-clicking just below previously mentioned and name it Icon. Value should be the path to the Visual Studio Code (in my case it’s C:\Program Files (x86)\Microsoft VS Code\Code.exe).

  6. Right-click on key created in step 3 and create a new key called command. Edit its first entry’s value to the path to the program (again, in my case it’s C:\Program Files (x86)\Microsoft VS Code\Code.exe) following by “%1” (including the quotes).

Do the same process again, but this time at the beginning search for key HKEY_CLASSES_ROOT\Directory\Background\shell. In step 3 instead of “%1” add . (a dot).