title: How to chain psftp commands in one single windows command line
body: <p>I need to run this chain of commands</p>
  
  <pre><code>psftp xx.xx.xx.xx -l xxx -pw yyy
  cd zzzzzz
  get file.csv
  bye
  </code></pre>
  
  <p>in one single command line </p>
  
  <p>(psftp comes from here: <a href="http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html" rel="nofollow noreferrer">http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html</a>)</p>
  
  <p>I have seen on superuser (<a href="https://superuser.com/a/532528/290138">https://superuser.com/a/532528/290138</a>) that with ftp you can do it like this but I don't understand how it works:</p>
  
  <pre><code>echo open xx.xx.xx.xx &gt;&gt; ftp &amp; echo user xxx yyy &gt;&gt; ftp &amp; echo binary &gt;&gt; ftp &amp; echo get file.csv &gt;&gt; ftp &amp;echo bye &gt;&gt; ftp &amp; ftp -n -v -s:ftp &amp; del ftp
  </code></pre>
  
  <p>Thanks!</p>
  
  <p>[EDIT]<br>
  I wrote those 4 lines in a <code>.bat</code> file and ran it.<br>
  The first line executes well, but then the psftp interpreter opens (it's like the ftp interpreter)<br>
  and the second line never happen</p>