Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
380 views
in Technique[技术] by (71.8m points)

windows 7 - Visual Studio Code "Open With Code" does not appear after right-clicking a folder

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.

enter image description here

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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*shellOpen with VS Code]
    @="Edit with VS Code"
    "Icon"="C:\Program Files (x86)\Microsoft VS Code\Code.exe,0"
    [HKEY_CLASSES_ROOT*shellOpen with VS Codecommand]
    @=""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_ROOTDirectoryshellvscode]
    @="Open Folder as VS Code Project"
    "Icon"=""C:\Program Files (x86)\Microsoft VS Code\Code.exe",0"
    [HKEY_CLASSES_ROOTDirectoryshellvscodecommand]
    @=""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_ROOTDirectoryBackgroundshellvscode]
    @="Open Folder as VS Code Project"
    "Icon"=""C:\Program Files (x86)\Microsoft VS Code\Code.exe",0"
    [HKEY_CLASSES_ROOTDirectoryBackgroundshellvscodecommand]
    @=""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

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...