Is there a way to launch Microsoft Visual Studio Code from the command line in windows? I can't even seem to find the directory for code on my computer. It didn't even ask me where to download it.
5 Answers
Navigate to the directory that you want to open and type code . to launch VS Code.
5 Comments
. if you type that it will open in the current folder of the cmd prompt.As many folks already suggested ways to open code from command prompt using code . command. This will only open Visual Studio Code Stable build. But If you have downloaded Visual Studio Code Insider build/version (Which has all latest build/features but unstable version) then you need to follow below instructions in windows :
- Go to Control Panel\System and Security\System. Click on Advanced System Settings

- Click on Environment Variables

- Under System Variables tab, Click on Edit for Path Variable

- Add a new path
C:\Users\tsabu\AppData\Local\Programs\Microsoft VS Code Insiders\bin(or)C:\Program Files\Microsoft VS Code Insiders\binbased on location at which you have installed vscode insider in your machine.
Open a new command prompt and typecode-insiders .to open vscode-insider build/version
1 Comment
Short answer:
code your_path your_filename
Long answer:
Here your_path can simply be . if you want to use the current directory as your working path. Or .. for 1 level up, etc.
code is the name of the executable of Visual Studio Code (code.exe). If it doesn't launch, perhaps your VSC path hasn't been added to the path environment variable. Run this command to add it:
set PATH=";C:\Program Files\Microsoft VS Code\bin"
Of course you'll need to specify a different path if your VSC is installed somewhere else.
How can you find out the installation path? (click for screenshot) Go to "Start" menu, type in "Visual Studio Code", right click on the found program, "Properties", check "Target". Now you'll see!
Comments
It may come already added to your path when installed. Try using code <filename> in your command line. If it's not you can add the command line script's directory to your path. The command line script's directory is downloaded by default in the following location
C:\Users\<username>\AppData\Local\Code\bin