# 其他

# 各类官方文档地址

# 工具类网站

在线工具

开源中国-在线工具

# 开发类问题查询

# 右键添加通过 Vscode 打开快捷方式

安装的路径最好用英文命名,否则这种方式可能不能用

  1. 点击下载vscode.reg文件,也可以复制如下代码:

    Windows Registry Editor Version 5.00
    
    [HKEY_CLASSES_ROOT\*\shell\VSCode]
    @="open with Code"
    "Icon"="C:\\Users\\name\\AppData\\Local\\Programs\\Microsoft VS Code\\Code.exe"
    
    [HKEY_CLASSES_ROOT\*\shell\VSCode\command]
    @="\"C:\\Users\\name\\AppData\\Local\\Programs\\Microsoft VS Code\\Code.exe\" \"%1\""
    
    Windows Registry Editor Version 5.00
    
    [HKEY_CLASSES_ROOT\Directory\shell\VSCode]
    @="open with Code"
    "Icon"="C:\\Users\\name\\AppData\\Local\\Programs\\Microsoft VS Code\\Code.exe"
    
    [HKEY_CLASSES_ROOT\Directory\shell\VSCode\command]
    @="\"C:\\Users\\name\\AppData\\Local\\Programs\\Microsoft VS Code\\Code.exe\" \"%V\""
    
    Windows Registry Editor Version 5.00
    
    [HKEY_CLASSES_ROOT\Directory\Background\shell\VSCode]
    @="open with Code"
    "Icon"="C:\\Users\\name\\AppData\\Local\\Programs\\Microsoft VS Code\\Code.exe"
    
    [HKEY_CLASSES_ROOT\Directory\Background\shell\VSCode\command]
    @="\"C:\\Users\\name\\AppData\\Local\\Programs\\Microsoft VS Code\\Code.exe\" \"%V\""
    
  1. 找到自己电脑安装的VsCode的地址,复制Code.exe的路径

    通过在桌面上的 VsCode 的快捷图标,右键-打开文件所在位置,可以快速打开VsCode的安装位置

  2. 用自己的路径信息全局替换文档中的C:\\Users\\name\\AppData\\Local\\Programs\\Microsoft VS Code\\Code.exe这一路径。记得给自己的路径加上转义符。比如我的路径如下D:\installed\software\Microsoft VS Code\Code.exe,加上转义符D:\\installed\\software\\Microsoft VS Code\\Code.exe

  3. 最后整个文件变为

    Windows Registry Editor Version 5.00
    
    [HKEY_CLASSES_ROOT\*\shell\VSCode]
    @="open with Code"
    "Icon"="D:\\installed\\software\\Microsoft VS Code\\Code.exe"
    
    [HKEY_CLASSES_ROOT\*\shell\VSCode\command]
    @="\"D:\\installed\\software\\Microsoft VS Code\\Code.exe\" \"%1\""
    
    Windows Registry Editor Version 5.00
    
    [HKEY_CLASSES_ROOT\Directory\shell\VSCode]
    @="open with Code"
    "Icon"="D:\\installed\\software\\Microsoft VS Code\\Code.exe"
    
    [HKEY_CLASSES_ROOT\Directory\shell\VSCode\command]
    @="\"D:\\installed\\software\\Microsoft VS Code\\Code.exe\" \"%V\""
    
    Windows Registry Editor Version 5.00
    
    [HKEY_CLASSES_ROOT\Directory\Background\shell\VSCode]
    @="open with Code"
    "Icon"="D:\\installed\\software\\Microsoft VS Code\\Code.exe"
    
    [HKEY_CLASSES_ROOT\Directory\Background\shell\VSCode\command]
    @="\"D:\\installed\\software\\Microsoft VS Code\\Code.exe\" \"%V\""
    
  4. 运行vscode.reg文件,遇到需要确认的地方直接点击

  5. 随便找一个文件,右键一下,会发现右键菜单中有一项open with Code。这样就可以用VsCode快捷打开文件了。