It took a long time to discover that WScript.Shell has such a great function!
Save it as GetStdOut.vbs, and in the command line, navigate to the corresponding directory and run:
cscript.exe GetStdOut.vbs "ping 127.1"
Look, isn't this coming out:
[ Last edited by electronixtar on 2006-6-7 at 17:19 ]
Set objShell = CreateObject("WScript.Shell")
Set objExecObject = objShell.Exec ("%comspec% /c " & wscript.arguments(0))
Do While Not objExecObject.StdOut.AtEndOfStream
strText = objExecObject.StdOut.ReadAll()
loop
msgbox strText
Save it as GetStdOut.vbs, and in the command line, navigate to the corresponding directory and run:
cscript.exe GetStdOut.vbs "ping 127.1"
Look, isn't this coming out:
Pinging 127.0.0.1 with 32 bytes of data:
Reply from 127.0.0.1: bytes=32 time<1ms TTL=128
Reply from 127.0.0.1: bytes=32 time<1ms TTL=128
Reply from 127.0.0.1: bytes=32 time<1ms TTL=128
Reply from 127.0.0.1: bytes=32 time<1ms TTL=128
Ping statistics for 127.0.0.1:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 0ms, Maximum = 0ms, Average = 0ms
[ Last edited by electronixtar on 2006-6-7 at 17:19 ]
