在命令行中键入代码以启动 vscode 时如何避免此 wsh 错误? [英] When typing code in command line to launch vscode how to avoid this wsh error?
问题描述
我有一个包含 code.js 文件的文件夹.
我想从该文件夹中的 cmd 启动 vscode,但是在键入code"时,出现 wsh 错误.如何强制启动 VSCode?p>
您可以通过键入禁用 .js 关联
assoc .js=
这将允许 cmd 搜索 %PATH% 以查找可执行文件,并且它会根据需要点击 vscode.
我相信你明白为什么会这样.Windows 正在查看您键入的命令的当前文件夹,并找到可执行的内容 (code.js),然后停止查找其他内容.
I have a folder which contains a code.js file.
I want to launch vscode from cmd within that folder but when typing "code", I get wsh error. How to force to launch VSCode instead ?
You can disable the .js association by typing
assoc .js=
That will allow cmd to search the %PATH% to find an executable and it will hit vscode as you wanted.
I am sure you realize why this is happening. Windows is looking at the current folder for the command you typed and finds something (code.js) that is executable, and stops looking for another.
这篇关于在命令行中键入代码以启动 vscode 时如何避免此 wsh 错误?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!