title: Feeding password and commands to remote ftp command using PuTTY
body: <p>I want to automate the process of copy a file from Windows FTP location to a Unix box from my Windows 7 machine.</p>
  
  <p>I have managed to search the net and succeed to the point of connecting to the Unix box using SSH and PuTTY. </p>
  
  <p>The input file to PuTTY contains the commands, but it stops at password and I couldn't find a way to overcome this.</p>
  
  <p>To do this I have a created a batch file, so I can schedule a Windows job on my Windows 7 machine to start copy a file everyday from the Windows FTP server (other Windows machine not mine) to the Unix box.</p>
  
  <p>Batch file:</p>
  
  <pre><code>putty -ssh lxdsdsp0  -l "user_1" -pw "mypass" -m "D:\cmd.txt" -t
  </code></pre>
  
  <p>My cmd.txt</p>
  
  <pre><code>cd /x06/scratch-data/ 
  ftp domain\user_1@winapp67.sr.dv.com
  mypass
  /bin/bash
  </code></pre>
  
  <p>When I execute my batch file, it logs in to the Unix box through SSH and types the commands but stops when I have my password as input file in the PuTTY <code>cmd.txt</code> file.</p>
  
  <p>Please help.</p>
  
  <pre><code>Using username "user_1".
  
  Welcome to SuSE Linux Enterprise Server 9 (x86_64)
  
  Connected to domain\user_1@winapp67.sr.dv.com.
  220 Microsoft FTP Service
  331 Password required for domain\user_1.
  Password:
  530 User domain\user_1 cannot log in.
  ftp: Login failed.
  ftp&gt;
  </code></pre>