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
这两个文件是 鼠标右键展示的文字