Isso ajuda:
dim objShell : set ObjShell = CreateObject("Wscript.Shell")
dim objFso : set objFso = CreateObject("Scripting.FileSystemObject")
dim shellstring : shellstring = "%comspec% /c ping -t -f -l 32 -w 1000 " & wscript.arguments(0)
dim oExec : set oExec = ObjShell.Exec(shellstring)
do while oExec.StdOut.AtEndOfStream <> true
log( oExec.StdOut.ReadLine )
loop
function log(strLineIn)
myDateFormat= Day(Now) & "-" & Month(Now) & "-" & Year(Now)
dim logfile : set logfile = objFso.OpenTextFile(wscript.arguments(1) & " " & myDateFormat & ".log", 8, True)
if instr(strLineIn, "TTL") > 0 then
logfile.writeline date() & "-" & time() & ": " & strLineIn
end if
logfile.close
end function