新建一个txt文件,然后复制如下代码:
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\*\shell\VSCode]
@="Open with Code"
"Icon"="D:\\VSCode\\Microsoft VS Code\\Code.exe"
[HKEY_CLASSES_ROOT\*\shell\VSCode\command]
@="\"D:\\VSCode\\Microsoft VS Code\\Code.exe\" \"%1\""
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\Directory\shell\VSCode]
@="Open with Code"
"Icon"="D:\\VSCode\\Microsoft VS Code\\Code.exe"
[HKEY_CLASSES_ROOT\Directory\shell\VSCode\command]
@="\"D:\\VSCode\\Microsoft VS Code\\Code.exe\" \"%V\""
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\Directory\Background\shell\VSCode]
@="Open with Code"
"Icon"="D:\\VSCode\\Microsoft VS Code\\Code.exe"
[HKEY_CLASSES_ROOT\Directory\Background\shell\VSCode\command]
@="\"D:\\VSCode\\Microsoft VS Code\\Code.exe\" \"%V\""
其中D:\VSCode为我的VSCode的安装目录,替换为你本机的即可,然后将这个txt文本的后缀修改为reg注册表文件,完成后直接双击运行,导入到注册表即可,此时在文件夹上右击就能看见使用VSCode打开的快捷键
补充说明:
安装目录查看
右键桌面vscode的图标,点击属性,查看起始位置如下
"C:\Users\Administrator\AppData\Local\Programs\Microsoft VS Code"
那么将C:\Users\Administrator\AppData\Local\Programs 全局替换 D:\VSCode