Skip to content

Instantly share code, notes, and snippets.

@emilpalsson
Last active May 4, 2023 16:00
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save emilpalsson/e713ab7d0c7f09246b2049ebb61fe602 to your computer and use it in GitHub Desktop.
Save emilpalsson/e713ab7d0c7f09246b2049ebb61fe602 to your computer and use it in GitHub Desktop.
Restore the "Open with Code" context menu (aka right click menu) items for the user installed version of vscode on Windows. To run, simply save the file (with the .reg file extension) and double click it.
Windows Registry Editor Version 5.00
; To use (expand) environment variables in the registry, the value must be of
; the type REG_EXPAND_SZ. A REG_EXPAND_SZ is represented as HEX in reg exports.
; Right click on any file
[HKEY_CURRENT_USER\Software\Classes\*\shell\vscode]
@="Open with Code"
"Icon"=hex(2):25,00,55,00,53,00,45,00,52,00,50,00,52,00,4f,00,46,00,49,00,4c,\
00,45,00,25,00,5c,00,41,00,70,00,70,00,44,00,61,00,74,00,61,00,5c,00,4c,00,\
6f,00,63,00,61,00,6c,00,5c,00,50,00,72,00,6f,00,67,00,72,00,61,00,6d,00,73,\
00,5c,00,4d,00,69,00,63,00,72,00,6f,00,73,00,6f,00,66,00,74,00,20,00,56,00,\
53,00,20,00,43,00,6f,00,64,00,65,00,5c,00,43,00,6f,00,64,00,65,00,2e,00,65,\
00,78,00,65,00,2c,00,30,00,00,00
; HEX value: %USERPROFILE%\AppData\Local\Programs\Microsoft VS Code\Code.exe,0
[HKEY_CURRENT_USER\Software\Classes\*\shell\vscode\command]
@=hex(2):22,00,25,00,55,00,53,00,45,00,52,00,50,00,52,00,4f,00,46,00,49,00,4c,\
00,45,00,25,00,5c,00,41,00,70,00,70,00,44,00,61,00,74,00,61,00,5c,00,4c,00,\
6f,00,63,00,61,00,6c,00,5c,00,50,00,72,00,6f,00,67,00,72,00,61,00,6d,00,73,\
00,5c,00,4d,00,69,00,63,00,72,00,6f,00,73,00,6f,00,66,00,74,00,20,00,56,00,\
53,00,20,00,43,00,6f,00,64,00,65,00,5c,00,43,00,6f,00,64,00,65,00,2e,00,65,\
00,78,00,65,00,22,00,20,00,22,00,25,00,31,00,22,00,00,00
; HEX value: "%USERPROFILE%\AppData\Local\Programs\Microsoft VS Code\Code.exe" "%1"
; Right click on a directory
[HKEY_CURRENT_USER\Software\Classes\Directory\shell\vscode]
@="Open with Code"
"Icon"=hex(2):25,00,55,00,53,00,45,00,52,00,50,00,52,00,4f,00,46,00,49,00,4c,\
00,45,00,25,00,5c,00,41,00,70,00,70,00,44,00,61,00,74,00,61,00,5c,00,4c,00,\
6f,00,63,00,61,00,6c,00,5c,00,50,00,72,00,6f,00,67,00,72,00,61,00,6d,00,73,\
00,5c,00,4d,00,69,00,63,00,72,00,6f,00,73,00,6f,00,66,00,74,00,20,00,56,00,\
53,00,20,00,43,00,6f,00,64,00,65,00,5c,00,43,00,6f,00,64,00,65,00,2e,00,65,\
00,78,00,65,00,2c,00,30,00,00,00
; HEX value: %USERPROFILE%\AppData\Local\Programs\Microsoft VS Code\Code.exe,0
[HKEY_CURRENT_USER\Software\Classes\Directory\shell\vscode\command]
@=hex(2):22,00,25,00,55,00,53,00,45,00,52,00,50,00,52,00,4f,00,46,00,49,00,4c,\
00,45,00,25,00,5c,00,41,00,70,00,70,00,44,00,61,00,74,00,61,00,5c,00,4c,00,\
6f,00,63,00,61,00,6c,00,5c,00,50,00,72,00,6f,00,67,00,72,00,61,00,6d,00,73,\
00,5c,00,4d,00,69,00,63,00,72,00,6f,00,73,00,6f,00,66,00,74,00,20,00,56,00,\
53,00,20,00,43,00,6f,00,64,00,65,00,5c,00,43,00,6f,00,64,00,65,00,2e,00,65,\
00,78,00,65,00,22,00,20,00,22,00,25,00,31,00,22,00,00,00
; HEX value: "%USERPROFILE%\AppData\Local\Programs\Microsoft VS Code\Code.exe" "%1"
; Right click on the background inside a directory
[HKEY_CURRENT_USER\Software\Classes\Directory\Background\shell\vscode]
@="Open with Code"
"Icon"=hex(2):25,00,55,00,53,00,45,00,52,00,50,00,52,00,4f,00,46,00,49,00,4c,\
00,45,00,25,00,5c,00,41,00,70,00,70,00,44,00,61,00,74,00,61,00,5c,00,4c,00,\
6f,00,63,00,61,00,6c,00,5c,00,50,00,72,00,6f,00,67,00,72,00,61,00,6d,00,73,\
00,5c,00,4d,00,69,00,63,00,72,00,6f,00,73,00,6f,00,66,00,74,00,20,00,56,00,\
53,00,20,00,43,00,6f,00,64,00,65,00,5c,00,43,00,6f,00,64,00,65,00,2e,00,65,\
00,78,00,65,00,2c,00,30,00,00,00
; HEX value: %USERPROFILE%\AppData\Local\Programs\Microsoft VS Code\Code.exe,0
[HKEY_CURRENT_USER\Software\Classes\Directory\Background\shell\vscode\command]
@=hex(2):22,00,25,00,55,00,53,00,45,00,52,00,50,00,52,00,4f,00,46,00,49,00,4c,\
00,45,00,25,00,5c,00,41,00,70,00,70,00,44,00,61,00,74,00,61,00,5c,00,4c,00,\
6f,00,63,00,61,00,6c,00,5c,00,50,00,72,00,6f,00,67,00,72,00,61,00,6d,00,73,\
00,5c,00,4d,00,69,00,63,00,72,00,6f,00,73,00,6f,00,66,00,74,00,20,00,56,00,\
53,00,20,00,43,00,6f,00,64,00,65,00,5c,00,43,00,6f,00,64,00,65,00,2e,00,65,\
00,78,00,65,00,22,00,20,00,22,00,25,00,56,00,22,00,00,00
; HEX value: "%USERPROFILE%\AppData\Local\Programs\Microsoft VS Code\Code.exe" "%V"
@fwd079
Copy link

fwd079 commented Aug 5, 2020

Doesn't work (anymore?_

@heitor76
Copy link

heitor76 commented May 4, 2023

It's still working (VS Code 1.78 - Windows 10)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment