問題原因
在安裝vscode時沒有將vscode添加進入右鍵菜單。
解決方案一:安裝包修復
再次運行vscode的安裝程序,在雙擊打開安裝程序,同意許可協議以后,會出現如下附加界面,勾選添加到上下文菜單。點擊下一步,程序就將自動為您在右鍵菜單添加vscode啟動項。
解決方案二:注冊表修改
-
新建一個以reg 作為后綴名的文件
-
右鍵編輯,輸入以下內容(**C:\Program Files\Microsoft VS Code\ ** 是你vscode的安裝路徑)。
Windows Registry Editor Version 5.00
; Open files
[HKEY_CLASSES_ROOT\*\shell\Open with VS Code]
@="Edit with VS Code"
"Icon"="C:\\Program Files\\Microsoft VS Code\\Code.exe,0"
[HKEY_CLASSES_ROOT\*\shell\Open with VS Code\command]
@="\"C:\\Program Files\\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:\\Program Files\\Microsoft VS Code\\Code.exe\",0" [HKEY_CLASSES_ROOT\Directory\shell\vscode\command] @="\"C:\\Program Files\\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:\\Program Files\\Microsoft VS Code\\Code.exe\",0"
[HKEY_CLASSES_ROOT\Directory\Background\shell\vscode\command]
@="\"C:\\Program Files\\Microsoft VS Code\\Code.exe\" \"%V\""
- 雙擊這個文件,執行注冊表合並,之后都選 “是”。