For i = 1 to 5
wscript.StdOut.Write i
next
For i = 1 to 5
wscript.StdOut.Write i
next
For i = 1 to 5
wscript.StdOut.Write i
next
For i = 1 to 5
wscript.StdOut.Write i
next
Once, this error appeared to me some time ago. In my case it was because I was running the script using WSCript in which there is no standard output.
There are two execution Host for the scripts. One is CScript.exe , designed for command line and the other is WSCript.exe designed to run using GUI (Double click).
To avoid this problem you can execute your script with CScript.exe, for example from a Command Window
cscript miscript.vbs
Or, you can set the Host cscript as the default, for this from a command window with administrator permissions run
cscript //H:CScript
To set Wscript as the default Host, from the command window with administrator permissions you run
cscript //H:WScript
Or, finally, you can use WScript.echo
instead of StdOut
. When using echo
, the message is automatically displayed by command line or by a dialog depending on whether the script was executed using CScript.exe or WScript.exe respectively.
Greetings