欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

将编辑器(vscode)添加到鼠标右键运行

程序员文章站 2022-03-09 18:20:44
...

1.在桌面创建一个.reg的文件,例如:add.reg

2…然后打开记事本编辑,将下面代码输入并保存

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\*\shell\VSCode]
@="Open with Code"
"Icon"="D:\\Microsoft Visual Studio Code\\Microsoft Visual Studio Code\\Code.exe"

[HKEY_CLASSES_ROOT\*\shell\VSCode\command]
@="\"D:\\Microsoft Visual Studio Code\\Microsoft Visual Studio Code\\Code.exe\" \"%1\""

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\Directory\shell\VSCode]
@="Open with Code"
"Icon"="D:\\Microsoft Visual Studio Code\\Microsoft Visual Studio Code\\Code.exe"

[HKEY_CLASSES_ROOT\Directory\shell\VSCode\command]
@="\"D:\\Microsoft Visual Studio Code\\Microsoft Visual Studio Code\\Code.exe\" \"%V\""

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\Directory\Background\shell\VSCode]
@="Open with Code"
"Icon"="D:\\Microsoft Visual Studio Code\\Microsoft Visual Studio Code\\Code.exe"

[HKEY_CLASSES_ROOT\Directory\Background\shell\VSCode\command]
@="\"D:\\Microsoft Visual Studio Code\\Microsoft Visual Studio Code\\Code.exe\" \"%V\""

其中全部D:\Microsoft Visual Studio Code\Microsoft Visual Studio Code\Code.exe都是你自己vscode的存放路径
将其改成你自己电脑上code.exe的存放路径即可

3.最后点击运行add.reg即可,会自动将vscode添加到注册表,鼠标右键即可显示 Open with Code