将下列代码保存为.reg文件,并且替换其中的路径,然后合并注册表即可:
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\*\shell\VSCode]
@="Open with VSCode"
"Icon"="D:\\Programs\\VSCode-win32-x64-1.75.1\\Code.exe"
[HKEY_CLASSES_ROOT\*\shell\VSCode\command]
@="\"D:\\Programs\\VSCode-win32-x64-1.75.1\\Code.exe\" \"%1\""
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\Directory\shell\VSCode]
@="Open with VSCode"
"Icon"="D:\\Programs\\VSCode-win32-x64-1.75.1\\Code.exe"
[HKEY_CLASSES_ROOT\Directory\shell\VSCode\command]
@="\"D:\\Programs\\VSCode-win32-x64-1.75.1\\Code.exe\" \"%V\""
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\Directory\Background\shell\VSCode]
@="Open with VSCode"
"Icon"="D:\\Programs\\VSCode-win32-x64-1.75.1\\Code.exe"
[HKEY_CLASSES_ROOT\Directory\Background\shell\VSCode\command]
@="\"D:\\Programs\\VSCode-win32-x64-1.75.1\\Code.exe\" \"%V\""
有时需要重启电脑,目前win10好像立即生效了。