Dim oShell, oExec, sLine
Set oShell = CreateObject("WScript.Shell")
Set oExec = oShell.Exec("ping google.com")
'Reading the output of the shell command thread
Do While Not oExec.StdOut.AtEndOfStream
sLine = oExec.StdOut.ReadLine
WScript.StdOut.WriteLine "Output: " & sLine
WScript.Sleep 10
Loop
'Waiting for the shell command thread to end
'In case the output ends before the command
Do While oExec.Status = 0
WScript.Sleep 100
Loop
Set oShell = CreateObject("WScript.Shell")
Set oExec = oShell.Exec("ping google.com")
'Reading the output of the shell command thread
Do While Not oExec.StdOut.AtEndOfStream
sLine = oExec.StdOut.ReadLine
WScript.StdOut.WriteLine "Output: " & sLine
WScript.Sleep 10
Loop
'Waiting for the shell command thread to end
'In case the output ends before the command
Do While oExec.Status = 0
WScript.Sleep 100
Loop