一直苦惱vscode怎么沒有右鍵打開文件夾的功能,原來是因為當初安裝時沒有勾選這個配置項。
所幸可以通過手動增加注冊表來實現。將下面的內容保存為一個“.reg”為后綴的文件后雙擊運行。
Windows Registry Editor Version 5.00 ; This will make it appear when you right click ON any file ; The "Icon" line can be removed if you don't want the icon to appear [HKEY_CLASSES_ROOT\*\shell\Open with VS Code] @="Edit with VS Code" "Icon"="C:\\Users\\bobin.yang\\AppData\\Local\\Programs\\Microsoft VS Code\\Code.exe,0" [HKEY_CLASSES_ROOT\*\shell\Open with VS Code\command] @="\"C:\\Users\\bobin.yang\\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 with VSCode" "Icon"="\"C:\\Users\\bobin.yang\\AppData\\Local\\Programs\\Microsoft VS Code\\Code.exe\",0" [HKEY_CLASSES_ROOT\Directory\shell\vscode\command] @="\"C:\\Users\\bobin.yang\\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 with VSCode" "Icon"="\"C:\\Users\\bobin.yang\\AppData\\Local\\Programs\\Microsoft VS Code\\Code.exe\",0" [HKEY_CLASSES_ROOT\Directory\Background\shell\vscode\command] @="\"C:\\Users\\bobin.yang\\AppData\\Local\\Programs\\Microsoft VS Code\\Code.exe\" \"%V\"" C:\\Users\\bobin.yang\\AppData\\Local\\Programs\\Microsoft VS Code\\Code.exe,0" [HKEY_CLASSES_ROOT\*\shell\Open with VS Code\command] @="\"C:\\Users\\bobin.yang\\AppData\\Local\\Programs\\Microsoft VS Code\\Code.exe\" \"%1\""