How to Run Multiple Instances of Visual Studio Code

vscode Mar 21, 2019

Visual Studio Code is my editor of choice when I'm working on front-end code. However, I kept running into an annoying problem every time I wanted to open different project folders:

Error: "A second instance of Code is already running as administrator."

The solution is to force VS Code to open a new session at all times, by using the -n flag.

I modified my VS Code shortcut as follows:

  1. Close all instances of VS Code.
  2. Search for VS Code in the Start Menu.

3. Click on "Open File Location" to locate the shortcut file. (You can also find it in \Users\<YourUsername>\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Visual Studio Code)

4. Right-click on the shortcut file and choose "Properties".

5. Modify the "Target" field by adding -n after the value.

Now you should be able to open many instances of VS Code!

Of course, you can do the same thing from the command line. Just type:

code -n

And you're all set!


Kristina Alberto

Software engineer from Sydney. I work at Domain Group.