0

When I try to open with "code ." command from the windows terminal, it is throwing an error.

code : The term 'code' is not recognized as the name of a cmdlet, function, script file, or operable program. Check
the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1
+ code .
+ ~~~~
    + CategoryInfo          : ObjectNotFound: (code:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

It was opening fine before. No idea what happened. I tried reinstalling and the issue still remains

  • this is not a django question it should be tagged with ```cmd``` or ```powershell``` that being said, I figure that ```code``` was an alias for ```vscode```. You may want to look at [this](https://stackoverflow.com/questions/20530996/aliases-in-windows-command-prompt) – Nnaobi Apr 06 '22 at 06:18
  • this is not a django question it should be tagged with ```cmd``` or ```powershell``` that being said, I your vscode added to ```PATH```? Is the link to the ```PATH``` correct? – Nnaobi Apr 06 '22 at 06:28
  • During the installation there is an option to add vs code to your PATH. either uninstall and install code with this option, or you can add the install location to your PATH as noted from @Steven-MSFT – GeralexGR Apr 06 '22 at 14:46

1 Answers1

0

What's the result of where code in the CMD? it should be C:\Program Files\Microsoft VS Code\bin\code, C:\Program Files\Microsoft VS Code\bin\code.cmd if you install the VSCode in the default location.

Please add the parent folder path of code to the system environment of Path.

Steven-MSFT
  • 5,738
  • 1
  • 3
  • 11