title: Redirect output processed via vbscript (cscript) to file
body: <p>Issue with command output:</p>
  
  <p>I am attempting to have a continuous ping report back to a text file.</p>
  
  <p>Started with:</p>
  
  <pre><code>ping 127.0.0.1 -t &gt;&gt; C:Textping.txt
  </code></pre>
  
  <p>Works great</p>
  
  <p>I also want to have timestamps listed before each ping</p>
  
  <p>So Wrote:</p>
  
  <pre><code>Dim str
  Do While Not WScript.StdIn.AtEndOfStream
    str = WScript.StdIn.ReadLine
    WScript.StdErr.WriteLine now &amp;amp; " - " &amp;amp; str
  Loop
  </code></pre>
  
  <p>Saved it as timestampLog.vbs on my desktop and dropped a copy into my system 32 folder.</p>
  
  <p>Put all of this into a batch file:</p>
  
  <pre><code>ping 127.0.0.1 -t | cscript //nologo timestamplog.vbs &gt;&gt; C:Pingtest1.txt
  </code></pre>
  
  <p>It works perfectly except that the output is printing to command prompt and Pingtest1.txt while created by the batch file is empty.</p>
  
  <p>Can someone please assist me with getting the output to Pingtest1.txt?</p>