Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio Code command in Windows not working properly

My question is, how can I make the VS Code command line work properly when manually adding it to PATH on Windows?

Inside of Visual Studio Code, I first tried to install it with the tickbox "install to PATH", but when I typed code in the command prompt, it said command not recognized. So I manually edited PATH and added C:\Program Files (x86)\Microsoft VS Code.

However, when running commands such as:

code -v

the command prompt doesn't print anything, but launches Visual Studio Code instead.

like image 203
AlexAlexson Avatar asked Mar 01 '17 21:03

AlexAlexson


1 Answers

Your path environment variable should include C:\Program Files (x86)\Microsoft VS Code\bin instead of C:\Program Files (x86)\Microsoft VS Code (notice the added \bin at the end).

The bin sub directory provides the batch file code.cmd, that processes the command line before launching code.exe from the parent directory. Going through the batch file is required for the command line to work properly.

like image 186
playerone Avatar answered Sep 27 '22 19:09

playerone