第一步:
配置文件 新建文本文檔.txt
D:\installPath\Microsoft VS Code\Code.exe 注意將此地方換成自己的vscode的安裝目錄就行
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\*\shell\VSCode]
@="Open with Code"
"Icon"="D:\\installPath\\Microsoft VS Code\\Code.exe"
[HKEY_CLASSES_ROOT\*\shell\VSCode\command]
@="\"D:\\installPath\\Microsoft VS Code\\Code.exe\" \"%1\""
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\Directory\shell\VSCode]
@="Open with Code"
"Icon"="D:\\installPath\\Microsoft VS Code\\Code.exe"
[HKEY_CLASSES_ROOT\Directory\shell\VSCode\command]
@="\"D:\\installPath\\Microsoft VS Code\\Code.exe\" \"%V\""
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\Directory\Background\shell\VSCode]
@="Open with Code"
"Icon"="D:\\installPath\\Microsoft VS Code\\Code.exe"
[HKEY_CLASSES_ROOT\Directory\Background\shell\VSCode\command]
@="\"D:\\installPath\\Microsoft VS Code\\Code.exe\" \"%V\""
第二步 改配置文件的后綴為 .reg唬血,例如:新建文本文檔.reg
第三步 雙擊 新建文本文檔.reg
如果出現(xiàn)安全警告或者彈框堕阔,需要選擇“允許程序本次執(zhí)行”末誓,就可以成功添加右鍵設(shè)置使用vscode打開。