Add option to open folder/file with VS Code [Win]
-
Get VSCode path.
-
Create a
.txt
file. -
Edit
.txt
file content.-
First, copy and paste the code below in the
.txt
fileWindows Registry Editor Version 5.00 [HKEY_CLASSES_ROOT\*\shell\Open with VS Code] @="Edit with VS Code" "Icon"="\path, 0" [HKEY_CLASSES_ROOT\*\shell\Open with VS Code\command] @="\path \"%1\"" [HKEY_CLASSES_ROOT\Directory\shell\vscode] @="Open folder with VS Code" "Icon"="\path, 0" [HKEY_CLASSES_ROOT\Directory\shell\vscode\command] @="\path \"%1\"" [HKEY_CLASSES_ROOT\Directory\Background\shell\vscode] @="Open folder with VS Code" "Icon"="\path, 0" [HKEY_CLASSES_ROOT\Directory\Background\shell\vscode\command] @="\path \"%V\""
-
Now replace
path
with the text you got from target propertie.My version looks like this:
Windows Registry Editor Version 5.00 [HKEY_CLASSES_ROOT\*\shell\Open with VS Code] @="Edit with VS Code" "Icon"="\"C:\Users\User\AppData\Local\Programs\Microsoft VS Code\Code.exe", 0" [HKEY_CLASSES_ROOT\*\shell\Open with VS Code\command] @="\"C:\Users\User\AppData\Local\Programs\Microsoft VS Code\Code.exe" \"%1\"" [HKEY_CLASSES_ROOT\Directory\shell\vscode] @="Open folder with VS Code" "Icon"="\"C:\Users\User\AppData\Local\Programs\Microsoft VS Code\Code.exe", 0" [HKEY_CLASSES_ROOT\Directory\shell\vscode\command] @="\"C:\Users\User\AppData\Local\Programs\Microsoft VS Code\Code.exe" \"%1\"" [HKEY_CLASSES_ROOT\Directory\Background\shell\vscode] @="Open folder with VS Code" "Icon"="\"C:\Users\User\AppData\Local\Programs\Microsoft VS Code\Code.exe", 0" [HKEY_CLASSES_ROOT\Directory\Background\shell\vscode\command] @="\"C:\Users\User\AppData\Local\Programs\Microsoft VS Code\Code.exe" \"%V\""
-
-
Save file as
.reg
. -
Execute
.reg
file.