文件右击添加vscode打开选项

文件右击添加vscode打开选项

效果如图:

方式一:运行注册文件

  • 在任意位置创建一个文本
  • 复制下面的代码到文件中以;开头的,是备注信息不需要做任何修改
  • 找到自己的vscode.exe文件所在的位置把上面带Code.exe的路径替换掉
  • 把上面的文件的后缀改成 reg 注册表专用的格式
  • 右键该文件, 管理员获得所有权
  • 双击运行该注册表文件, 如果被360什么的拦截了, 点击同意就行了
Windows Registry Editor Version 5.00
; Open files
[HKEY_CLASSES_ROOT\*\shell\Open with VS Code]
@="Edit with VS Code"
"Icon"="E:\\sys-ware\\Microsoft VS Code\\Code.exe,0"

[HKEY_CLASSES_ROOT\*\shell\Open with VS Code\command]
@="\"E:\\sys-ware\\Microsoft VS Code\\Code.exe\" \"%1\""

; This will make it appear when you right click ON a folder
; The "Icon" line can be removed if you don't want the icon to appear

[HKEY_CLASSES_ROOT\Directory\shell\vscode]
@="Open in VScode"
"Icon"="\"E:\\sys-ware\\Microsoft VS Code\\Code.exe\",0"

[HKEY_CLASSES_ROOT\Directory\shell\vscode\command]
@="\"E:\\sys-ware\\Microsoft VS Code\\Code.exe\" \"%1\""

; This will make it appear when you right click INSIDE a folder
; The "Icon" line can be removed if you don't want the icon to appear

[HKEY_CLASSES_ROOT\Directory\Background\shell\vscode]
@="Open in VScode"
"Icon"="\"E:\\sys-ware\\Microsoft VS Code\\Code.exe\",0"

[HKEY_CLASSES_ROOT\Directory\Background\shell\vscode\command]
@="\"E:\\sys-ware\\Microsoft VS Code\\Code.exe\" \"%V\""

方式二: 在注册表中进行配置

1.win + r 调出运行窗口 运行 regedit 指令
2.在shell目录新建项vscode
位置:计算机\HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Directory\shell\
3.按照图中文件配置, 配置好重启即可

image

posted @ 2021-01-06 13:53  眼睛会发光ω  阅读(522)  评论(0编辑  收藏  举报