当前位置:网站首页>Fix the problem that the right mouse button does not have a vscode shortcut

Fix the problem that the right mouse button does not have a vscode shortcut

2022-06-11 06:19:00 Empty nest youth_ rui

Fix right mouse button does not vscode The problem of quick entry


Problem description :

If installing vscode The vscode Add to Explorer context menu , Then you can't use the right mouse button to quickly pass vscode Open a file or folder . This is in addition to reinstallation vscode outside , You can also add a right-click shortcut by adding a registration key to the registry .
 Insert picture description here


resolvent :

adopt Code There are three scenarios to open :

  • Right click folder , have access to vscode open
  • Right click the single file , have access to vscode Editing
  • Right click the blank space , have access to vscode open

This corresponds to three registry entries , Create a text file on the desktop , Name it at will , After creation, rewrite the suffix to .reg.
Then right-click the file , choice “ edit ” Open file , Paste in the following :

Windows Registry Editor Version 5.00
 
[HKEY_CLASSES_ROOT\*\shell\VSCode]
@="Edit with VS Code"
"Icon"="D:\\Microsoft VS Code\\Code.exe"
 
[HKEY_CLASSES_ROOT\*\shell\VSCode\command]
@="\"D:\\Microsoft VS Code\\Code.exe\" \"%1\""
 
Windows Registry Editor Version 5.00
 
[HKEY_CLASSES_ROOT\Directory\shell\VSCode]
@="Open with VS Code"
"Icon"="D:\\Microsoft VS Code\\Code.exe"
 
[HKEY_CLASSES_ROOT\Directory\shell\VSCode\command]
@="\"D:\\Microsoft VS Code\\Code.exe\" \"%V\""
 
Windows Registry Editor Version 5.00
 
[HKEY_CLASSES_ROOT\Directory\Background\shell\VSCode]
@="Open with VS Code"
"Icon"="D:\\Microsoft VS Code\\Code.exe"
 
[HKEY_CLASSES_ROOT\Directory\Background\shell\VSCode\command]
@="\"D:\\Microsoft VS Code\\Code.exe\" \"%V\""

Be careful : need Change the file path to your local computer vscode Installation path for , Can pass vscode View the properties of the shortcut . At the same time Will copy... In the path Single \ Change to double \\ .

After editing , Save the file , Right click on the file to execute “ Merge ” operation , Merge the registry file into the registry of this computer .
Right click to view vscode A quick entrance to .


Description of the registration item statement :

Windows Registry Editor Version 5.00
 
[HKEY_CLASSES_ROOT\*\shell\VSCode] ; The menu that pops up when you right-click a file 
@="Edit with VS Code" ; Displayed text 
"Icon"="D:\\Microsoft VS Code\\Code.exe" ; The icon displayed 
 
[HKEY_CLASSES_ROOT\*\shell\VSCode\command] ; Commands to execute 
@="\"D:\\Microsoft VS Code\\Code.exe\" \"%1\"" ; Specific command code ,%1 Represents the first parameter , Right click the path of the selected file 
 
Windows Registry Editor Version 5.00
 
[HKEY_CLASSES_ROOT\Directory\shell\VSCode] ; The menu that pops up when you right-click a folder 
@="Open with VS Code"
"Icon"="D:\\Microsoft VS Code\\Code.exe"
 
[HKEY_CLASSES_ROOT\Directory\shell\VSCode\command]
@="\"D:\\Microsoft VS Code\\Code.exe\" \"%V\"" ;%V The meaning is the same as %1, Just replace with the current working path when the path is empty 
 
Windows Registry Editor Version 5.00
 
[HKEY_CLASSES_ROOT\Directory\Background\shell\VSCode] ; A menu pops up when you right-click an empty space in a folder 
@="Open with VS Code"
"Icon"="D:\\Microsoft VS Code\\Code.exe"
 
[HKEY_CLASSES_ROOT\Directory\Background\shell\VSCode\command]
@="\"D:\\Microsoft VS Code\\Code.exe\" \"%V\""
原网站

版权声明
本文为[Empty nest youth_ rui]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/162/202206110609330395.html