'cscript' is not recognized inside a batch

喜你入骨 提交于 2020-01-05 08:34:07

问题


I need to call a .bat that calls a .vbs. When i run FindDir.vbs from command prompt is ok, but when i try to call it from CallingVbs.bat i got the error message.

'cscript' is not recognized as an internal or external command.

The code i'm using to call .vbs is the same to .bat and to command prompt.

cscript FindDir.vbs

Both files are in same folder. I do not understand why cscript command works in command prompt but not in .bat. Could anyone explain me why it happens?

Thanks


回答1:


By mistake i was using a variable with name "path", so cscript stopped working.

I solve it with this




回答2:


Very simply you solve this issue. but before that you must ensure the cscript.exe file exist in your C:\Windows\System32 path. then,

%SystemRoot%\System32\then your command line



来源:https://stackoverflow.com/questions/13976872/cscript-is-not-recognized-inside-a-batch

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!