【程序猿】Window 右键菜单添加 VSCode

本人平时并不经常使用VScode编程,今天突然要用到,但是发现我并不能右键在文件夹下直接使用VScode打开工程??难道我的是假的 ?? 于是乎去查了资料。

最终的样子:

image.png

实现过程:

  1. 新建一个名为 xxx.reg的文件,一定需要带上 .reg 后缀。
  2. 查看的VScode安装目录,可以右键桌面的VScode快捷方式,查看属性就知道了。以我的安装地址为例:E:\\Microsoft VS Code\\Code.exe , 单反斜杠都换成双反斜杠。
  3. 复制以下内容到刚刚新建的 xxx.reg 文件中。
Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\*\shell\VSCode]
@="Open with Code"
"Icon"="E:\\Microsoft VS Code\\Code.exe"

[HKEY_CLASSES_ROOT\*\shell\VSCode\command]
@="\"E:\\Microsoft VS Code\\Code.exe\" \"%1\""

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\Directory\shell\VSCode]
@="Open with Code"
"Icon"="E:\\Microsoft VS Code\\Code.exe"

[HKEY_CLASSES_ROOT\Directory\shell\VSCode\command]
@="\"E:\\Microsoft VS Code\\Code.exe\" \"%V\""

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\Directory\Background\shell\VSCode]
@="Open with Code"
"Icon"="E:\\Microsoft VS Code\\Code.exe"

[HKEY_CLASSES_ROOT\Directory\Background\shell\VSCode\command]
@="\"E:\\Microsoft VS Code\\Code.exe\" \"%V\""
  1. 双击xxx.reg文件,弹出询问是否注册,点击确定;
  2. 找个目录试试吧。

你可能感兴趣的:(【程序猿】Window 右键菜单添加 VSCode)