简体   繁体   中英

VS code not opening from terminal with code . command in windows 11

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

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 .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM