Associated files
1. Open Win R and run, enter regedit, open the registry, find the HKEY_CLASSES_ROOT\*\shell branch, if not For shell branch, right-click under * and select "New - Item" to create a shell branch.
2. Create a new "VisualCode" item under the shell, and enter "open with visual code" in the "Default" key value column of the right window. This is the value displayed by the VisualCode startup program when you right-click the mouse. . The name and key value of the item can be arbitrary, as long as the meaning is clear. The key value will be displayed in the right-click menu.
3. Create a new Command item under "VisualCode" and enter the path of the Notepad program in the "Default" key value column of the right window. Mine is: "D:\Program Files (x86 )\Microsoft VS Code\code.exe" "%1". The %1 represents the file parameters to be opened. That is the Visual Code startup program. If you can't find it, search for Visual Studio Code in the start, then right-click to open the file location
4, close the registry, and it will take effect.
Associated folders
The above method can display: "open with visual code" in the menu bar when right-clicking on the file, but it still cannot be done when right-clicking on the folder. This option is displayed, so you need to perform the following operations:
Open the registry, find HKEY_CLASSES_ROOT\Directory\shell
, and add it according to the methods 2 and 3 above.
Add Icon
Create a new expandable string value on the original item, name it Icon, and put D:\Program like a key-value pair Files (x86)\Microsoft VS Code\code.exe just put it in.
Delete
When updating the program or uninstalling Visual code, just find the corresponding location in the registry and modify or delete it.
By the way, the right-click binding deletion of 360 Security Guard: find "HKEY_CLASSES_ROOT\*\shellex\ContextMenuHandlers"; if it is an item that is only valid for the folder, store it in
“HKEY_CLASSES_ROOT\Directory\shell” “HKEY_CLASSES_ROOT\Directory\shellex\ContextMenuHandlers” “HKEY_CLASSES_ROOT\Folder\shell” “HKEY_CLASSES_ROOT\Folder\shellex\ContextMenuHandlers”
Just delete them after you find them.
Recommended related articles and tutorials: vscode tutorial
The above is the detailed content of Add vscode shortcut on right click. For more information, please follow other related articles on the PHP Chinese website!