Visual Studio Code “Open With Code” does not appear after right-clicking a folder

后端 未结 16 1201
鱼传尺愫
鱼传尺愫 2020-12-05 03:39

Just installed Visual Studio Code 1.1.1 on a Windows 7 machine. When I right-click on a folder, \"Open With Code\" does not appear.

相关标签:
16条回答
  • 2020-12-05 04:19

    If you have vscode installed already and you want the "open with code" option.

    Just download vscode from the official website... here!

    Run the installer with the option "open with code" checked.

    It will update the existing vscode install with the "open with code" option.

    0 讨论(0)
  • 2020-12-05 04:23

    Just re run the installer and select the options in the setup and let it install. You'll not loose any data. Everything will be still intact as it was before. It just adds the missing settings and updates the path.

    0 讨论(0)
  • 2020-12-05 04:24

    Here comes the version of file provided by Cockney Rhyming Jedi before suitable for use with 64-bit version of Visual Studio Code:

    Windows Registry Editor Version 5.00
    ; Open files
    [HKEY_CURRENT_USER\Software\Classes\*\shell\Open with VS Code]
    @="Edit with VS Code"
    "Icon"="C:\\Program Files\\Microsoft VS Code\\Code.exe,0"
    [HKEY_CURRENT_USER\Software\Classes\*\shell\Open with VS Code\command]
    @="\"C:\\Program Files\\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_CURRENT_USER\Software\Classes\Directory\shell\vscode]
    @="Open Folder as VS Code Project"
    "Icon"="\"C:\\Program Files\\Microsoft VS Code\\Code.exe\",0"
    [HKEY_CURRENT_USER\Software\Classes\Directory\shell\vscode\command]
    @="\"C:\\Program Files\\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_CURRENT_USER\Software\Classes\Directory\Background\shell\vscode]
    @="Open Folder as VS Code Project"
    "Icon"="\"C:\\Program Files\\Microsoft VS Code\\Code.exe\",0"
    [HKEY_CURRENT_USER\Software\Classes\Directory\Background\shell\vscode\command]
    @="\"C:\\Program Files\\Microsoft VS Code\\Code.exe\" \"%V\""
    
    0 讨论(0)
  • 2020-12-05 04:27

    Copied from http://thisdavej.com/right-click-on-windows-folder-and-open-with-visual-studio-code/

    • Create file vsCodeOpenFolder.reg with this content (If you didn't chose the default installation path then you need to adjust the paths in this file):

      Windows Registry Editor Version 5.00
      ; Open files
      [HKEY_CLASSES_ROOT\*\shell\Open with VS Code]
      @="Edit with VS Code"
      "Icon"="C:\\Program Files (x86)\\Microsoft VS Code\\Code.exe,0"
      [HKEY_CLASSES_ROOT\*\shell\Open with VS Code\command]
      @="\"C:\\Program Files (x86)\\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 Folder as VS Code Project"
      "Icon"="\"C:\\Program Files (x86)\\Microsoft VS Code\\Code.exe\",0"
      [HKEY_CLASSES_ROOT\Directory\shell\vscode\command]
      @="\"C:\\Program Files (x86)\\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 Folder as VS Code Project"
      "Icon"="\"C:\\Program Files (x86)\\Microsoft VS Code\\Code.exe\",0"
      [HKEY_CLASSES_ROOT\Directory\Background\shell\vscode\command]
      @="\"C:\\Program Files (x86)\\Microsoft VS Code\\Code.exe\" \"%V\""
      
    • Double click it to create the registry entries

    • If the "Open with Code" doesn't appear in the Explorer's context menu then you should restart your system.
    • If you're running the 64-bit or Insiders version of VS Code, change the path accordingly
    0 讨论(0)
  • 2020-12-05 04:27

    Just run the installer again with open in file explorer option selected. You'll be all set.

    Don't worry about the files already opened in vsCode, none of them will be changed

    0 讨论(0)
  • 2020-12-05 04:29

    NB: This is for the 32-bit version, for the 64-bit version see Cepharum's answer.

    Slight change to the previous answer to allow non Admins to get the functionality in their context menus:

    • Create file vsCodeOpenFolder.reg with this content (If you didn't chose the default installation path then you need to adjust the paths in this file):

      Windows Registry Editor Version 5.00
      ; Open files
      [HKEY_CURRENT_USER\Software\Classes\*\shell\Open with VS Code]
      @="Edit with VS Code"
      "Icon"="C:\\Program Files (x86)\\Microsoft VS Code\\Code.exe,0"
      [HKEY_CURRENT_USER\Software\Classes\*\shell\Open with VS Code\command]
      @="\"C:\\Program Files (x86)\\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_CURRENT_USER\Software\Classes\Directory\shell\vscode]
      @="Open Folder as VS Code Project"
      "Icon"="\"C:\\Program Files (x86)\\Microsoft VS Code\\Code.exe\",0"
      [HKEY_CURRENT_USER\Software\Classes\Directory\shell\vscode\command]
      @="\"C:\\Program Files (x86)\\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_CURRENT_USER\Software\Classes\Directory\Background\shell\vscode]
      @="Open Folder as VS Code Project"
      "Icon"="\"C:\\Program Files (x86)\\Microsoft VS Code\\Code.exe\",0
      [HKEY_CURRENT_USER\Software\Classes\Directory\Background\shell\vscode\command]
      @="\"C:\\Program Files (x86)\\Microsoft VS Code\\Code.exe\" \"%V\""
      
    • Double click it to create the registry entries

    • If the "Open with Code" doesn't appear in the Explorer's context menu then you should restart your system.

    Essentially I have replaced HKEY_CLASSES_ROOT with HKEY_CURRENT_USER\Software\Classes

    0 讨论(0)
提交回复
热议问题