8

I have 10 applications that I constantly work on. At times I need to open them all up separately to run bash commands on them. Is there a way I can create a windows shortcut for each folder, then I select all 10 shortcuts and click enter to initiate 10 different VSCode applications each opens up with their respective folder I set to?

4 Answers 4

19

(Windows 10) To open VS Code in desired directory using shortcut:

  • Create shortcut to Visual Code Studio app,
  • Right click on the shortcut and select Properties,
  • In Target field append your directory path (remember to use quotes " " if there are spaces in the path).

Screenshot

Sign up to request clarification or add additional context in comments.

3 Comments

This also works great with .code-workspace files.
Do you know the virtual workspace equivalent e.g github?
Can this method be used to open WSL workspace?
1

ctr + K + O open a folder vs code most common shortcut key available all platforms same enter image description here

https://code.visualstudio.com/shortcuts/keyboard-shortcuts-windows.pdf

2 Comments

did you try this
This wasn't what I asked but, I accepted it to give you a point. What I want is, shortcut on desktop that I can click which will open Visual Studio code with lets say folder A. Then another shortcut I click opens Visual Studio Code with folder B. I don't want to open Visual studio code and move between folders even with using some shortcuts to change folders. I'd have to move between 10 different folders, more annoying than opening up 10 different visual studio code instances.
1

I use a batch file like in Sean's solution. You can automatically close the terminal after launch if you use the start command rather than "code ."

Here's an example:

@echo off cd "C:\path\to\your\project\folder\" start "" "C:\Program Files\Microsoft VS Code\Code.exe" . exit 

Note: if you don's like how the batch file looks, you can make a shortcut to the batch file and change the shortcut's icon to the VS Code icon.

Comments

0

In a similar situation, I use a batch file to launch my most used vscode windows. I am not yet smart enough to make the cmd windows disappear after they open vscode, but maybe someday. In each batch file, use the following changing the directory for each project.

@ECHO OFF cd C:\directory\where\your\project\is code . exit 

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.