'How to open folder in new vs code instance by right clicking on the folder?

I have open two folders inside a VS Code instance.

For example (folder name): A and B

I want to open the folder B in a new instance of VS Code, but there is no option to open by right-clicking on the folder.

enter image description here

Even Atom has the option to open the folder in a new instance.

enter image description here



Solution 1:[1]

This extension allows you to open a folder in a new vscode window.
Open Folder Context Menus for VS Code

Solution 2:[2]

You can go via File > New window or ctrl+shift+n for a new window, and open the second folder there.

Or the "window.openFoldersInNewWindow" setting:

// Controls if folders should open in a new window or replace the last active window.
// - default: folders will open in a new window unless a folder is picked from within the application (e.g. via the File menu)
// - on: folders will open in a new window
// - off: folders will replace the last active window
// Note that there can still be cases where this setting is ignored (e.g. when using the -new-window or -reuse-window command line option).
"window.openFoldersInNewWindow": "default",

Solution 3:[3]

Create a registry File e.g. OpenOnRightClick.reg

Add these lines to the file:

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

Change the location of visual studio code as per your installation directory Now just double click on the OpenOnRightClick.reg file, confirm if asked ! All done ! on you right click you will have a open with Code option.

Solution 4:[4]

Let's make it very simple

  1. In vscode , Go to Files --> New Window, as shown in the image below. This will open a blank vscode window, where we will open new project.

enter image description here

  1. Drag the project folder and drop it into the vscode. as shown in the below image

enter image description here

That's it. New blank window has the new project opened.

Another way is discussed below

  1. Go to Folder URL which you want to open in the vscode. On the file location, type in the URL cmd
  2. cmd prompt will open with the folder URL.
  3. In the cmd prompt, type code .
  4. Your folder will open in the new vscode window.

Solution 5:[5]

I also wanted that feature in my editor so I saved my settings and preferences and then I reinstalled VS Code in order to check the box that adds "Open with Code" as action in the context menu:

example

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Dan
Solution 2 katsho
Solution 3 Manish S
Solution 4
Solution 5