1、新建reg后缀文件:addRegedit.reg
2、复制以下内容到文件中
注:只替换D:\\vscode\\Microsoft VS Code\\Code.exe,要注意windows中得用\\
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\*\shell\VSCode]
@="Open with VsCode"#可自己替换为自己想要的名字,就是右键的显示的名称
"Icon"="D:\\vscode\\Microsoft VS Code\\Code.exe"
[HKEY_CLASSES_ROOT\*\shell\VSCode\command]
@="\"D:\\vscode\\Microsoft VS Code\\Code.exe\" \"%1\""
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\Directory\shell\VSCode]
@="Open with VsCode"
"Icon"="D:\\vscode\\Microsoft VS Code\\Code.exe"
[HKEY_CLASSES_ROOT\Directory\shell\VSCode\command]
@="\"D:\\vscode\\Microsoft VS Code\\Code.exe\" \"%V\""
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\Directory\Background\shell\VSCode]
@="Open with VsCode"
"Icon"="D:\\vscode\\Microsoft VS Code\\Code.exe"
[HKEY_CLASSES_ROOT\Directory\Background\shell\VSCode\command]
@="D:\\vscode\\Microsoft VS Code\\Code.exe"
3、运行addRegedit.reg文件,右键就可以看到了
注册表内容、值:
右键显示: