- 新建一个名为 1.reg 的文件,找一个记事本或者sublime打开,名称无所谓,但是一定需要带上 .reg 后缀。
- 查看你自己的电脑的vscode安装目录,最简单的方法就是右键桌面的vscode,查看属性就知道了。以我的安装地址为例:D:\Program Files\Microsoft VS Code\Code.exe , 单反斜杠最好都换成双反斜杠。
- 复制一下内容到 1.reg 文件中。
Windows Registry Editor Version 5.00
; Open files
[HKEY_CLASSES_ROOT\*\shell\Open with VS Code]
@="Edit with VS Code"
"Icon"="D:\\Program Files\\Microsoft VS Code\\Code.exe,0"
[HKEY_CLASSES_ROOT\*\shell\Open with VS Code\command]
@="\"D:\\Program Files\\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 Folder as VS Code Project"
"Icon"="\"D:\\Program Files\\Microsoft VS Code\\Code.exe\",0"
[HKEY_CLASSES_ROOT\Directory\shell\vscode\command]
@="\"D:\\Program Files\\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 Folder as VS Code Project"
"Icon"="\"D:\\Program Files\\Microsoft VS Code\\Code.exe\",0"
[HKEY_CLASSES_ROOT\Directory\Background\shell\vscode\command]
@="\"D:\\Program Files\\Microsoft VS Code\\Code.exe\" \"%V\""
- 替换所有vscode的安装路径。
- 双击这个文件,之后都选 “是”。