1.新建一个名为 vscode.reg
的文件,找一个记事本或者sublime打开,名称无所谓,但是一定需要带上 .reg
后缀。
Windows Registry Editor Version 5.00 [HKEY_CLASSES_ROOT*shellVSCode] @="Open with Code" "Icon"="C:\Program Files\Microsoft VS Code\Code.exe" [HKEY_CLASSES_ROOT*shellVSCodecommand] @=""C:\Program Files\Microsoft VS Code\Code.exe" "%1"" Windows Registry Editor Version 5.00 [HKEY_CLASSES_ROOTDirectoryshellVSCode] @="Open with Code" "Icon"="C:\Program Files\Microsoft VS Code\Code.exe" [HKEY_CLASSES_ROOTDirectoryshellVSCodecommand] @=""C:\Program Files\Microsoft VS Code\Code.exe" "%V"" Windows Registry Editor Version 5.00 [HKEY_CLASSES_ROOTDirectoryBackgroundshellVSCode] @="Open with Code" "Icon"="C:\Program Files\Microsoft VS Code\Code.exe" [HKEY_CLASSES_ROOTDirectoryBackgroundshellVSCodecommand] @=""C:\Program Files\Microsoft VS Code\Code.exe" "%V""
或者手动添加:注册表窗口->HKEY_CLASSES_ROOT->Directory->shell,添加VSCode项,修改默认数据值,添加command并修改command数据值