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

后端 未结 16 1225
鱼传尺愫
鱼传尺愫 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:09

    Paste the code below and save with .reg extension

    Windows Registry Editor Version 5.00 ; Open files
    
    [HKEY_CURRENT_USER\Software\Classes\*\shell\Open with VS Code] @="Edit with VS Code" 
    
    "Icon"="C:\Users\hp\AppData\Local\Programs\Microsoft VS Code\Code.exe,0" 
    
    [HKEY_CURRENT_USER\Software\Classes\*\shell\Open with VS Code\command] 
    
    @="\"C:\Users\hp\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_CURRENT_USER\Software\Classes\Directory\shell\vscode] 
    @="Open Folder as VS Code Project"
    
    "Icon"="\"C:\Users\hp\AppData\Local\Programs\Microsoft VS Code\Code.exe",0"
    
    [HKEY_CURRENT_USER\Software\Classes\Directory\shell\vscode\command]
    
    @="\"C:\Users\hp\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_CURRENT_USER\Software\Classes\Directory\Background\shell\vscode]
    
    @="Open Folder as VS Code Project"
    
    "Icon"="\"C:\Users\hp\AppData\Local\Programs\Microsoft VS Code\Code.exe",0
    
    [HKEY_CURRENT_USER\Software\Classes\Directory\Background\shell\vscode\command]
    
    @="\"C:\Users\hp\AppData\Local\Programs\Microsoft VS Code\Code.exe" \"%V\""
    

    Then press the Windows key, locate Visual Studio Code, then right click and open file the location:

    open vscode location

    Right click and click Properties, then copy the file path.

    enter image description here

    Open regedit:

    reg edit

    For each of the following, double click on the icon, and paste the file path you copied from above:

    [HKEY_CURRENT_USER\Software\Classes\*\shell\Open with VS Code]
    [HKEY_CURRENT_USER\Software\Classes\*\shell\Open with VS Code\command]
    [HKEY_CURRENT_USER\Software\Classes\Directory\shell\vscode]
    [HKEY_CURRENT_USER\Software\Classes\Directory\shell\vscode\command]
    [HKEY_CURRENT_USER\Software\Classes\Directory\Background\shell\vscode]
    [HKEY_CURRENT_USER\Software\Classes\Directory\Background\shell\vscode\command]
    

    enter image description here

提交回复
热议问题