title: VBS Run cmd.exe output to a variable; not text file
body: <p>This is what I have so far.  It works; outputing the folder path to temp to a text file.
  What I really want, is to output the data to a variable.  Every example I see online, show how to do this using something like: </p>
  
  <pre><code>set objScriptExec = wshShell.Exec (strCommand) 
  </code></pre>
  
  <p>followed by </p>
  
  <pre><code>strresult = LCase(objScriptExec.StdOut.ReadAll. // code
  </code></pre>
  
  <p>I want this to run with <code>Run</code>, not <code>Exec</code>, because I want the command prompt windows to be hidden as I will performing many commands with the code below.  How can I capture that output to a variable? </p>
  
  <pre><code>Set wsShell = CreateObject("WScript.Shell")
  strCommand = "cmd /c echo %temp% &gt; %temp%\test.txt"
  wsShell.Run strcommand,0,True
  </code></pre>