Search code examples
batch-filevbscriptwsh

'cscript' is not recognized inside a batch


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


Solution

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

    I solve it with this