title: Batch script to log in SSH server on Windows
body: <p>I'm trying to make a batch script to log in into a SSH server and execute a few commands. The start command is:</p>
  
  <p><code>plink -ssh user@99.99.999.99</code></p>
  
  <p>Then I need to enter the User Name and Password like the image:</p>
  
  <p><img src="https://i.stack.imgur.com/jtrj0.jpg" alt="ssh"></p>
  
  <p>If I have the 'User Name' and 'Password' in two variables, how do I use them when it asks me for?</p>
  
  <p><strong>[EDIT]</strong></p>
  
  <p>last try was this:</p>
  
  <pre><code>(echo username
  echo mypassword) | plink -ssh user@99.99.999.99
  </code></pre>
  
  <p>Output:</p>
  
  <pre><code>User Name:username
  mypassword
  Password:
  </code></pre>
  
  <p>The batch didn't "pressed" enter after inputing the username.</p>