The code. not recognized as internal or external command

I want to open a directory using cmd in Visual Studio Code, but this gives me an error in cmd. So what settings are required for this?

I executed below command

D:\RND>code .
+13
source share
4 answers

It needs to be configured so that the code is in yours PATH. If you are running on a mac system , follow these steps (for Windows systems, see below):

  1. Launch VS Code
  2. Open the command palette (click F1) and enter shell commandto find Shell Command: Install 'code' command in PATH command.
  3. Restart terminal

enter image description here

If you are running on Windows, you can also set PATH manually by adding:

C:\Program Files (x86)\Microsoft VS Code\bin

to your PATH environment variable.

  1. Open command prompt
  2. setx path "% path%; C:\Program Files (x86)\Microsoft VS Code\bin"
+15

- , cmd . ( โ†’ )

+5

, , VS-, Program Files (x86), 32- Program Files, 64- VS- , Run (Win + r) cmd : setx path "%path%;C:\Program Files (x86)\Microsoft VS Code"

setx path "%path%;C:\Program Files\Microsoft VS Code"

code ., VS- .

+2

O/S

C:\Users\chawki\AppData\Local\Programs\Microsoft VS Code\bin C:\Users\chawki\AppData\Local\Programs\Microsoft VS Code\bin.

Like this.

+1

Source: https://habr.com/ru/post/1687130/


All Articles