title: How to get Plink command response in a vbscript variable?
body: <p>I am checking for the number of files I have in a Unix Directory, and I am trying to get that number in a VBScript variable.</p>
  
  <p>My code:</p>
  
  <pre><code>set oShell = CreateObject("WScript.Shell")
  oShell.Run "C:\PLINK.EXE -ssh user@host -pw abc find /my/files -name '*333*' | wc -l &gt; C:\files\res.txt"
  set oShell = Nothing
  </code></pre>
  
  <p>The above code didn't write in the <code>.txt</code> file. I was thinking that i'll read the <code>.txt</code> file using vbscript and get the count.</p>
  
  <p>Is there a direct way to to get the count returned from <code>wc -l</code> in a vbscript variable.</p>
  
  <p>thank you.</p>