> 技术文档 > VSCode(Visual Studio Code) 菜单右键消失最新解决办法,亲测有效

VSCode(Visual Studio Code) 菜单右键消失最新解决办法,亲测有效

目录

黑色星期一

快餐(50%好用)

细粮(100%好用)

HKEY_CLASSES_ROOT\\*\\shell\\OpenInVSCode

HKEY_CLASSES_ROOT\\Directory\\shell\\vscode

HKEY_CLASSES_ROOT\\Directory\\Background\\shell\\vscode

效果图


 

 

黑色星期一

亲,如果你看到这篇博文是周一,那么恭喜你,说明你周末没加班。但是我知道,周一你一觉醒来忽然发现自己的电脑右键变干净了,没有“使用VSCode”打开菜单了!哈哈哈哈。好在我周末加班发现了这个问题,该踩得雷我已经踩过。你只要按我说的一步步做起来就OK了!

VSCode(Visual Studio Code) 菜单右键消失最新解决办法,亲测有效

 

解决办法:

分别在如下注册表项添加:

  • [HKEY_CLASSES_ROOT\\*\\shell\\OpenInVSCode] 
  • [HKEY_CLASSES_ROOT\\*\\shell\\OpenInVSCode\\command] 
  • [HKEY_CLASSES_ROOT\\Directory\\shell\\vscode] 
  • [HKEY_CLASSES_ROOT\\Directory\\shell\\vscode\\command] 
  • [HKEY_CLASSES_ROOT\\Directory\\Background\\shell\\vscode] 
  • [HKEY_CLASSES_ROOT\\Directory\\Background\\shell\\vscode\\command] 

具体做法:

最佳方法

还有一个方案,去官网下载旧版的vscode然后重新安装

快餐(50%好用)

你要是嫌麻烦,就直接把我下面的代码拷贝到本地,把VSCode路径替换成你自己的,另存为.reg,然后一键批处理就行了。但这个办法不是百分百好用

Windows Registry Editor Version 5.00 ; Open files [HKEY_CLASSES_ROOT\\*\\shell\\Open with VS Code] @=\"Edit with VS Code\" \"Icon\"=\"C:\\U\\sers\\\\Hisoon\\\\AppData\\\\Local\\\\Programs\\\\Microsoft VS Code\\\\Code.exe,0\" [HKEY_CLASSES_ROOT\\*\\shell\\Open with VS Code\\command] @=\"\\\"C:\\U\\sers\\\\Hisoon\\\\AppData\\\\Local\\\\Programs\\\\Microsoft VS Code\\\\Code.exe\\\" \\\"%1\\\"\" ; This will make it appear when you right click ON a folder ; The \"Icon\" line can be removed if you don\'t want the icon to appear [HKEY_CLASSES_ROOT\\Directory\\shell\\vscode] @=\"Open Folder as VS Code Project\" \"Icon\"=\"\\\"C:\\U\\sers\\\\Hisoon\\\\AppData\\\\Local\\\\Programs\\\\Microsoft VS Code\\\\Code.exe\\\",0\" [HKEY_CLASSES_ROOT\\Directory\\shell\\vscode\\command] @=\"\\\"C:\\U\\sers\\\\Hisoon\\\\AppData\\\\Local\\\\Programs\\\\Microsoft VS Code\\\\Code.exe\\\" \\\"%1\\\"\" ; This will make it appear when you right click INSIDE a folder ; The \"Icon\" line can be removed if you don\'t want the icon to appear [HKEY_CLASSES_ROOT\\Directory\\Background\\shell\\vscode] @=\"Open Folder as VS Code Project\" \"Icon\"=\"\\\"C:\\U\\sers\\\\Hisoon\\\\AppData\\\\Local\\\\Programs\\\\Microsoft VS Code\\\\Code.exe\\\",0\" [HKEY_CLASSES_ROOT\\Directory\\Background\\shell\\vscode\\command] @=\"\\\"C:\\U\\sers\\\\Hisoon\\\\AppData\\\\Local\\\\Programs\\\\Microsoft VS Code\\\\Code.exe\\\" \\\"%V\\\"\"

细粮(100%好用)

下面的办法通用性更强,解决问题效果更好,只是稍微慢点,按win+R输入regedit进入注册表。

VSCode(Visual Studio Code) 菜单右键消失最新解决办法,亲测有效

HKEY_CLASSES_ROOT\\*\\shell\\OpenInVSCode

找到路径

HKEY_CLASSES_ROOT\\*\\shell\\

新建“项”,命名为:OpenInVSCode

在“默认”里面填“Edit with VS Code”

新建“可扩充字符串值”,命名为Icon(就是菜单中显示的VS小蓝色图标)

在Icon的“数值数据”中填写你的VSCode安装路径,到具体的可执行文件,如下

xxxxx你的VSCode安装路径xxxx\\Code.exe

VSCode(Visual Studio Code) 菜单右键消失最新解决办法,亲测有效

在OpenInVSCode下新建子项命名为:Command

在“默认”下面填

\"xxxxx你的VSCode安装路径xxxx\\Code.exe\" \"%1\"

在command下新建“可扩充字符串值”,命名为Icon(就是菜单中显示的VS小蓝色图标)

在Icon的“数值数据”中填写你的VSCode安装路径,到具体的可执行文件,如下

xxxxx你的VSCode安装路径xxxx\\Code.exe

VSCode(Visual Studio Code) 菜单右键消失最新解决办法,亲测有效  

HKEY_CLASSES_ROOT\\Directory\\shell\\vscode

找到路径

HKEY_CLASSES_ROOT\\Directory\\shell\\

新建“项”,命名为vscode,

在其“默认”里面填写菜单提示字符“使用VsCode打开”

新建“可扩充字符串值”,命名为Icon(就是菜单中显示的VS小蓝色图标)

在Icon的“数值数据”中填写你的VSCode安装路径,到具体的可执行文件,如下

xxxxx你的VSCode安装路径xxxx\\Code.exe

VSCode(Visual Studio Code) 菜单右键消失最新解决办法,亲测有效

在vscode下新建子项命名:command,

在command下的默认里面填写

\"xxxxx你的VSCode安装路径xxxx\\Code.exe\" \"%1\"

在command下新建“可扩充字符串”,命名为Icon,其值填写

xxxxx你的VSCode安装路径xxxx\\Code.exe

VSCode(Visual Studio Code) 菜单右键消失最新解决办法,亲测有效

HKEY_CLASSES_ROOT\\Directory\\Background\\shell\\vscode

找到路径

HKEY_CLASSES_ROOT\\Directory\\Background\\shell\\

新建项“VisualCode”,在其默认值里面填写“使用VsCode打开”

新建“可扩展字符串”命名为Icon。

其数据数值设为

xxxxx你的VSCode安装路径xxxx\\Code.exe

VSCode(Visual Studio Code) 菜单右键消失最新解决办法,亲测有效

在VisualCode下新建子项command

其默认值设为“”

\"xxxxx你的VSCode安装路径xxxx\\Code.exe\" \"%V\"

新建“可扩展字符串”命名为Icon。

其数据数值设为

xxxxx你的VSCode安装路径xxxx\\Code.exe

VSCode(Visual Studio Code) 菜单右键消失最新解决办法,亲测有效

效果图

VSCode(Visual Studio Code) 菜单右键消失最新解决办法,亲测有效 VSCode(Visual Studio Code) 菜单右键消失最新解决办法,亲测有效 VSCode(Visual Studio Code) 菜单右键消失最新解决办法,亲测有效