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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With