将程序加到右键菜单命令详解
这里以加vscode程序到右键菜单为示例
;右键选中文件
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\*\shell\VSCode]
@="Edit with VsCode"
"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 folder with VsCode"
"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 VsCode"
"Icon"="D:\\Microsoft VS Code\\_\\Code.exe"
[HKEY_CLASSES_ROOT\Directory\Background\shell\VSCode\command]
@="\"D:\\Microsoft VS Code\\_\\Code.exe\" \"%V\""
将上述命令复制到新建的.reg文件里面,双击执行即可,如果不能正确执行,删掉中文注释即可
也可以注册表中直接添加删除对应路径的配置,还可以将配置导出成.reg文件
win+r --> regedit --> 对应路径
将程序移除右键菜单的命令
[-HKEY_CLASSES_ROOT\*\shell\VSCode]
[-HKEY_CLASSES_ROOT\Directory\shell\VSCode]
[-HKEY_CLASSES_ROOT\Directory\Background\shell\VSCode]
其他博文:https://www.cnblogs.com/lizhenlin/p/6581614.html