这俩天看B站视频,发现作者可以直接右键可以用VS Code打开,而我没有,原因是安装的时候没有勾选到右键菜单里面,所以需要修改一下注册表,具体操作如下:

新建一个文本文档,然后复制以下内容填入。

Windows Registry Editor Version 5.00
  
[HKEY_CLASSES_ROOT\*\shell\VSCode]
@="Open with Code"
"Icon"="D:\\Microsoft VS Code\\Code.exe"
  
[HKEY_CLASSES_ROOT\*\shell\VSCode\command]
@="\"D:\\Microsoft VS Code\\Code.exe\" \"%1\""
  
Windows Registry Editor Version 5.00
  
[HKEY_CLASSES_ROOT\Directory\shell\VSCode]
@="Open with Code"
"Icon"="D:\\Microsoft VS Code\\Code.exe"
  
[HKEY_CLASSES_ROOT\Directory\shell\VSCode\command]
@="\"D:\\Microsoft VS Code\\Code.exe\" \"%V\""
  
Windows Registry Editor Version 5.00
  
[HKEY_CLASSES_ROOT\Directory\Background\shell\VSCode]
@="Open with Code"
"Icon"="D:\\Microsoft VS Code\\Code.exe"
  
[HKEY_CLASSES_ROOT\Directory\Background\shell\VSCode\command]
@="\"D:\\Microsoft VS Code\\Code.exe\" \"%V\""

找到VS Code的文件位置,并修改上述内容的相关路径,然后另存为.reg文件,并启动。

此时会弹出一个修改注册表的提示,选择是就可以了。

End
最后修改:2022 年 10 月 12 日
如果觉得我的文章不错,请随手点赞~