Search code examples
windowsvisual-studio-code

The VSCode `code .` command is not working in the terminal/command prompt in Windows


this is the line i get when i did shell command in VS code

I get this error:

code . is not recognised as an external or internal command, operable program or batch file

Morevoer, shell commands are not coming in my compiler VS code neither do setx path "%path%;C:\Program Files\Microsoft VS Code" is working in command prompt .


Solution

  • I found it. In the "search" type environment variables then click on the "edit system environment variables".

    Inside Environment variables->Path put C:\Users\{your_username}\AppData\Local\Programs\Microsoft VS Code\bin.

    Go to the project folder and open the cmd with it typing in the location bar and then type code .

    That will do.