注意:这里只是拿VS Code作为例子
安装注册表,新建文本文件,以.reg为拓展名保存,双击安装

  • 文件的鼠标右击点击事件
1
2
3
4
5
6
7
8
9
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\""

  • 文件夹上右击点击事件
1
2
3
4
5
6
7
8
9
Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\Directory\shell\vscode]
@="Open with VSCode"
"Icon"="\"D:\\Microsoft VS Code\\Code.exe\",0"

[HKEY_CLASSES_ROOT\Directory\shell\vscode\command]
@="\"D:\\Microsoft VS Code\\Code.exe\" \"%1\""

  • 桌面的鼠标右击点击事件
1
2
3
4
5
6
7
8
9
Windows Registry Editor Version 5.00

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

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