title: What is correct syntax to use AWK in VBScript?
body: <p>I have a VBScript which Telnets into a Linux device and I would like to see the available memory.  The following command produces an "Invalid procedure call or argument" error.</p>
  
  <pre><code>WshShell.SendKeys"df /mnt/cf | awk '/mnt/{print$2}'"
  </code></pre>
  
  <p>This works if I manually telnet into the device and use the same command. Any advice?</p>
  
  <p>Code so far:</p>
  
  <pre><code>Dim WshShell
  
  Set WshShell = CreateObject("WScript.Shell")
  WshShell.run"cmd" 
  '*** open command window *** 
  WScript.Sleep 250 WshShell.SendKeys("{Enter}") 
  WshShell.SendKeys"telnet 10.13.2.2 -f VBSmemSize.txt" 
  WshShell.SendKeys("{Enter}") 
  WScript.Sleep 2000 
  WshShell.SendKeys"root" 
  WshShell.SendKeys("{Enter}") 
  WScript.Sleep 1500 
  WshShell.SendKeys"password" 
  WshShell.SendKeys("{Enter}") 
  WScript.Sleep 1500 
  WshShell.SendKeys"df /mnt/cf |awk '/mnt/{print$2}'" 
  WshShell.SendKeys("{Enter}")
  </code></pre>