Windows Registry Editor Version 5.00 ; Open files [HKEY_CLASSES_ROOT\*\shell\Open with VS Code] @="Edit with VS Code" "Icon"="E:\\vscode\\Microsoft VS Code\\Code.exe,0" [HKEY_CLASSES_ROOT\*\shell\Open with VS Code\command] @="\"E:\\vscode\\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 in VScode" "Icon"="\"E:\\vscode\\Microsoft VS Code\\Code.exe\",0" [HKEY_CLASSES_ROOT\Directory\shell\vscode\command] @="\"E:\\vscode\\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 in VScode" "Icon"="\"E:\\vscode\\Microsoft VS Code\\Code.exe\",0" [HKEY_CLASSES_ROOT\Directory\Background\shell\vscode\command] @="\"E:\\vscode\\Microsoft VS Code\\Code.exe\" \"%V\""
具體使用流程
1. 在任意位置創建一個文本
2. 復制上面的代碼到文件中 , 以 ; 開頭的 , 是備注信息 , 不需要做任何修改
3 . 找到自己的vscode.exe 文件所在的位置 , 把上面 帶
Code.exe
的所有路徑照葫蘆畫瓢寫上去
4. 把上面的文件的后綴改成 reg 注冊表專用的格式
5. 右鍵該文件, 管理員獲得所有權
6. 雙擊運行該注冊表文件, 如果被360什么的攔截了, 點擊同意就行了
Open in VScode
Edit with VS Code
這兩個文件是 鼠標右鍵展示的文字