title: wait for process to complete before going on to next step vbs
body: <p>This is my vbs code</p>
  
  <pre><code>Set obj = CreateObject("WScript.Shell")
  obj.Exec "C:\Program Files\putty.exe -load " + "111.22.33.44"
  WScript.Sleep 5000
  obj.SendKeys "abc"
  obj.SendKeys("{Enter}")
  WScript.Sleep 3000
  obj.SendKeys "abc123"
  obj.SendKeys("{Enter}")
  WScript.Sleep 3000
  </code></pre>
  
  <p>This code is functioning properly, however if i try it on a different computer sometimes it does not work. As soon as putty loads the username and password is entered without the terminal asking for it. Is there an alternative way like the following logic</p>
  
  <pre><code>waitforstring = uname :
  if waitforstring = true
  obj.sendKey "abc"
  </code></pre>
  
  <p>any help on this is appreciated, Thanks</p>