title: FTP server responses are sometimes undetected in batch
body: <p>I'm running a batch file in Win2003 to transfer a file via FTP.</p>
  
  <p>The batch file pipes the FTP session results into a FIND to see if there's a 226 success message, and this works well.  Unfortunately, from a scheduler I'm hitting the errorlevel condition, even though the file transfers successfully and the 226 message is returned.</p>
  
  <pre><code>FTP -s:go.ftp 2&gt;NUL | Find "226 Transfer OK" &gt; NUL
  If ErrorLevel 1 Echo ERROR - FTP transfer failed. &gt;&gt; err.log
  </code></pre>
  
  <p>The user account is an admin account, so it's not a rights issue.  Any ideas?</p>
  
  <p><strong>UPDATE:</strong></p>
  
  <p>The 226 message is not being captured via redirect, thus failing the FIND.  In my testing, I redirected the FTP output to a separate file when run from the scheduler.  Although the FTP commands are running successfully, none of the server responses are appearing.</p>
  
  <p>Here is my FTP script:</p>
  
  <pre><code>open ftpsite
  username
  password
  dir
  quit
  </code></pre>
  
  <p>Here is the output ( <code>FTP -s:go.ftp &gt;ftp.log 2&gt;ftp.err</code> ).</p>
  
  <pre><code>User (ftpsite:(none)): open ftpsite
  04-01-12  02:35PM       &lt;DIR&gt;          DIR1
  
  04-01-12  02:35PM       &lt;DIR&gt;          DIR2
  
  04-01-12  02:35PM       &lt;DIR&gt;          DIR3
  
  04-01-12  02:35PM       &lt;DIR&gt;          DIR4
  
  
  
  dir 
  quit
  </code></pre>
  
  <p>Additionally, nothing appears in the error stream ( 2>ftp.err ). At least I know now why my FIND's errorlevel isn't being triggered, but why aren't the FTP server responses being captured?  I'm not using the -v switch or toggling verbose.</p>