1、新建reg文件;在vscode安裝目錄下新建一個(gè)文本文件,然后將文件后綴改為:*.reg,文件名任意,例如:vsCodeOpenFolder.reg。
2、編寫文本文件內(nèi)容.將下面的內(nèi)容Copy到剛才新建的*.reg文件中,文本內(nèi)容如下
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\*\shell\VSCode]@="Open with Code""Icon"="D:\\Program Files\\Microsoft VS Code\\Code.exe" [HKEY_CLASSES_ROOT\*\shell\VSCode\command]@="\"D:\\Program Files\\Microsoft VS Code\\Code.exe\" \"%1\""
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\Directory\shell\VSCode]@="Open with Code""Icon"="D:\\Program Files\\Microsoft VS Code\\Code.exe" [HKEY_CLASSES_ROOT\Directory\shell\VSCode\command]@="\"D:\\Program Files\\Microsoft VS Code\\Code.exe\" \"%V\"" Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\Directory\Background\shell\VSCode]@="Open with Code""Icon"="D:\\Program Files\\Microsoft VS Code\\Code.exe"
[HKEY_CLASSES_ROOT\Directory\Background\shell\VSCode\command]@="\"D:\\Program Files\\Microsoft VS Code\\Code.exe\" \"%V\""?
注意:以上加粗字體請(qǐng)換成本機(jī)vscode的安裝路徑
3.文件編輯好了之后保存關(guān)閉.然后雙擊運(yùn)行?vsCodeOpenFolder.reg ,遇到提示點(diǎn)擊 “確定"或"是”