Redirect output processed via vbscript (cscript) to file
问题 Issue with command output: I am attempting to have a continuous ping report back to a text file. Started with: ping 127.0.0.1 -t >> C:Textping.txt Works great I also want to have timestamps listed before each ping So Wrote: Dim str Do While Not WScript.StdIn.AtEndOfStream str = WScript.StdIn.ReadLine WScript.StdErr.WriteLine now & " - " & str Loop Saved it as timestampLog.vbs on my desktop and dropped a copy into my system 32 folder. Put all of this into a batch file: ping 127.0.0.1 -t |