How to launch VS Code using command line (2020)

Last updated on September 23, 2020 A Goodman Loading... Post a comment

This article shows you how to how to add code to the path in Windows and macOS so that you can launch the VS Code in any directory by running:

code .

You can also open a file with VS Code by executing this:

code [filename]

How to add “code” to the path?

Note: In Windows, Visual Studio Code is automatically added to your PATH. If it doesn’t work as expected or you’re using macOS, try the steps listed below.

Firstly, launch your VS Code and go to View > Command Palette, search for command and click on Shell Command: Install ‘code’ command in PATH.

A message will show up like this:

Done!

Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments

Related Articles