Tag not monitored by Microsoft.
Use WScript.Echo "Hello" line only (remove other lines) and start the script in console using this command: cscript test.vbs.
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Hello everybody.
Can i run .vbs file in the command line and get there printed output?
I tried :
Dim StdOut : Set StdOut = CreateObject("Scripting.FileSystemObject").GetStandardStream(1)
WScript.Echo "Hello"
WScript.StdOut.Write "Hello"
WScript.StdOut.WriteLine "Hello"
Stdout.WriteLine "Hello"
Stdout.Write "Hello"
Thanks for help.
Tag not monitored by Microsoft.
Use WScript.Echo "Hello" line only (remove other lines) and start the script in console using this command: cscript test.vbs.
Windows has 2 VB script processors, WScript.exe (GUI) and CScript.exe (console). To get the output to display in a command prompt you have to use cscript.exe.
cscript.exe C:\MyScriptsFolder\MyScript.vbs
If you just type in the script name Windows will use the default which is wscript.exe. You can change that from an admin command prompt.
cscript.exe //H:CScript