这对我有用,如果不适合你,请参考 (https://marketplace.visualstudio.com/items?itemName=GregTrevellick.OpeninVisualStudio2017Enterprise):
1. 打开 notepad.exe 并将其粘贴到其中:
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\*\shell\VSCode\command]
@="\"C:\\Program Files (x86)\\Microsoft VS Code\\Code.exe\" \"%1\""
这是我导出的注册表文件,以防万一你需要它(你不应该):
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\*\shell\VSCode\command]
@=hex(2):22,00,43,00,3a,00,5c,00,50,00,72,00,6f,00,67,00,72,00,61,00,6d,00,20,\
00,46,00,69,00,6c,00,65,00,73,00,20,00,28,00,78,00,38,00,36,00,29,00,5c,00,\
4d,00,69,00,63,00,72,00,6f,00,73,00,6f,00,66,00,74,00,20,00,56,00,53,00,20,\
00,43,00,6f,00,64,00,65,00,5c,00,43,00,6f,00,64,00,65,00,2e,00,65,00,78,00,\
65,00,22,00,20,00,22,00,25,00,31,00,22,00,00,00
2.另存为VSElevated.reg
3. 转到您保存 .reg 文件的位置并双击,对所有内容都是,然后确定。
4.这就是您的注册表之后的样子:
我认为原因是您的启动命令中缺少%1。这应该解决它。