环境:win10
问题:手动卸载旧VSCode不干净,然后又安装了新的,导致鼠标右键快捷方式失效
分析:报错提示为找不到路径,由于新安装路径和原来不同,推测是未能正确指明新exe路径
解决:修改注册表
win + R 输入 regedit 打开注册表
地址栏:
- 计算机\HKEY_CLASSES_ROOT\*\shell\VSCode
- 计算机\HKEY_CLASSES_ROOT\Directory\shell\VSCode
- 计算机\HKEY_CLASSES_ROOT\Directory\Background\shell\VSCode
按如下格式依次编辑各项,其中...*\shell\VSCode\command取值为"C:\Program Files\Microsoft VS Code\Code.exe" "%1",其他command取值为 "C:\Program Files\Microsoft VS Code\Code.exe" "%V"
至于数值中的exe路径,可以通过 『桌面vscode的快捷方式 - 属性』快速复制
参考
https://blog.youkuaiyun.com/weixin_43863487/article/details/125208748
https://thisdavej.com/right-click-on-windows-folder-and-open-with-visual-studio-code/