1.需要在注册表里面添加内容可以实现,下面有一种简单的方式来完成这个操作。
2.需要在电脑桌面新建一个Open File With VS code.reg 文件然后用打开文件,将以下代码复制
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\*\shell\VSCode]
@="Open with VSCode"
"Icon"="E:\\VScode\\Microsoft VS Code\\Code.exe"
[HKEY_CLASSES_ROOT\*\shell\VSCode\command]
@="\"E:\\VScode\\Microsoft VS Code\\Code.exe\" \"%1\""
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\Directory\shell\VSCode]
@="Open with VSCode"
"Icon"="E:\\VScode\\Microsoft VS Code\\Code.exe"
[HKEY_CLASSES_ROOT\Directory\shell\VSCode\command]
@="\"E:\\VScode\\Microsoft VS Code\\Code.exe\" \"%V\""
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\Directory\Background\shell\VSCode]
@="Open with VSCode"
"Icon"="E:\\VScode\\Microsoft VS Code\\Code.exe"
[HKEY_CLASSES_ROOT\Directory\Background\shell\VSCode\command]
@="\"E:\\VScode\\Microsoft VS Code\\Code.exe\" \"%V\""
3. 其中 E:\\VScode\\Microsoft VS Code\\Code.exe 部分是你的vscode安装到的路径
4.然后双击运行之后,你的电脑就可以快捷用vscode打开文件和文件夹了