Skip to content

Instantly share code, notes, and snippets.

@ayuthmang
Last active January 9, 2021 14:23
Show Gist options
  • Save ayuthmang/aa138ee552d19ee00b0ba4155d21f435 to your computer and use it in GitHub Desktop.
Save ayuthmang/aa138ee552d19ee00b0ba4155d21f435 to your computer and use it in GitHub Desktop.
Install command line for VS Code on Windows, macOS

Call VS Code via command line on windows

Set up by cmd or powershell

  1. Run cmd or powershell as administrator.

  2. Type setx path "%path%;<YOUR VSCODE PATH>".

  3. Open new cmd or powershell and type 'code'.

  4. Press enter.

  5. Open new cmd or powershell and type 'code', the VS Code will be open up.

Setup by UI via windows Environments Variables (Windows 10)

  1. Right click on your computer icon.
  2. click 'Properties'.
  3. click 'Advanced system settings', wait until The dialog 'System Properties' will be shown up.
  4. Navigate to 'Advanced' tab.
  5. On bottom right click button 'Environments Variables'.
  6. Select on variable 'path' of your system variable and click 'Edit' button.
  7. Click 'New' button' and place your VS Code path into it.
  8. Press 'OK'
  9. Open cmd or powershell and try to type 'code', the VS Code will be open up.

macOS

  1. Open your VS Code.
  2. Press Command + Shift + P.
  3. Type 'shell command'.
  4. Select Install 'code command in PATH.

Or you will setup it manual via https://code.visualstudio.com/docs/setup/mac.

Related links:

http://www.dowdandassociates.com/blog/content/howto-set-an-environment-variable-in-windows-command-line-and-registry/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment