1.将编辑器添加到鼠标右键,方便使用,如下图:
2.在桌面创建一个.reg的文件,例如add.reg*
3.然后打开记事本编辑,将下面代码输入并保存
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\*\shell\VSCode]
@="Open with Code"
"Icon"="D:\\Microsoft Visual Studio Code\\Microsoft Visual Studio Code\\Code.exe"
[HKEY_CLASSES_ROOT\*\shell\VSCode\command]
@="\"D:\\Microsoft Visual Studio Code\\Microsoft Visual Studio Code\\Code.exe\" \"%1\""
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\Directory\shell\VSCode]
@="Open with Code"
"Icon"="D:\\Microsoft Visual Studio Code\\Microsoft Visual Studio Code\\Code.exe"
[HKEY_CLASSES_ROOT\Directory\shell\VSCode\command]
@="\"D:\\Microsoft Visual Studio Code\\Microsoft Visual Studio Code\\Code.exe\" \"%V\""
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\Directory\Background\shell\VSCode]
@="Open with Code"
"Icon"="D:\\Microsoft Visual Studio Code\\Microsoft Visual Studio Code\\Code.exe"
[HKEY_CLASSES_ROOT\Directory\Background\shell\VSCode\command]
@="\"D:\\Microsoft Visual Studio Code\\Microsoft Visual Studio Code\\Code.exe\" \"%V\""
其中全部D:\Microsoft Visual Studio Code\Microsoft Visual Studio Code\Code.exe都是你自己vscode的存放路径
将其改成你自己电脑上code.exe的存放路径即可
4.最后点击运行add.reg即可