title: VBS send password of SSH in windows powershell -
body: <p>I try to create a script for automatically connect to SSH. I have a variables with all parameters of SSH (username, password, port, ip). </p>
  
  <p>If I launch, in a VBS script:</p>
  
  <pre><code>Set objShell = CreateObject("Wscript.shell")
  objShell.run("powershell -noexit ssh.exe " &amp; user &amp; "@" &amp; ip &amp; " -p " &amp; port &amp; "")
  </code></pre>
  
  <p>the powershell opens correctly and ask me a password of server...but</p>
  
  <p>How can I send the password in VBS script? I have variable "pass" with the password of server (SSH).</p>
  
  <blockquote>
    <p>Please Help me I have try a lot of solutions but it's doesn't works.</p>
  </blockquote>
  
  <p>I have try with:</p>
  
  <pre><code>objShell.run("powershell -noexit &amp; ssh.exe " &amp; user &amp; "@" &amp; ip &amp; " -p " &amp; porta &amp; "; " &amp; pass &amp;"")
  
  objShell.run("powershell -noexit ssh.exe " &amp; user &amp; "@" &amp; ip &amp; " -p " &amp; porta &amp; " + " &amp; pass &amp;"")
  </code></pre>
  
  <p>with ";" the script passed the password but it doesn't send it when ssh ask me a password.</p>
  
  <blockquote>
    <p>Also, I would ask the obvious question, why not write it all in
    powershell?</p>
  </blockquote>
  
  <p>I already have a script in VBS and I want to change only the line of connection (now works fine with cygwin).</p>
  
  <blockquote>
    <p>Why run it from PowerShell at all? Just run ssh.exe directly. Or even
    easier, just run the ssh command directly from the PowerShell prompt
    (PowerShell is a shell; it can run commands you type - that's one of
    the reasons it exists).</p>
  </blockquote>
  
  <p>I must launch powershell from a script and send the password of SSH automatically (I don't want to type the password manually).</p>