title: ftp mget not working when used in a script
body: <p>I am trying to get a number of files from a Unix machine using an MS DOS ftp script (Windows 7). I am new to this so I have been trying to modify an on-line example. The code is as follows:</p>
  
  <pre><code>@echo off
  SETLOCAL
  
  REM ##################################
  REM Change these parameters
  set FTP_HOST=host
  set FTP_USER=user
  set FTP_REMOTE_DIR=/users/myAcc/logFiles
  set FTP_REMOTE_FILE=*.log
  set FTP_LOCAL_DIR=C:\Temp
  set FTP_TRANSFER_MODE=ascii
  REM ##################################
  set FTP_PASSWD=password
  
  set SCRIPT_FILE=%TEMP%\ftp.txt
  (
      echo %FTP_USER%
      echo %FTP_PASSWD%
      echo %FTP_TRANSFER_MODE%
      echo lcd %FTP_LOCAL_DIR%
      echo cd  %FTP_REMOTE_DIR%
      echo prompt
      echo mget %FTP_REMOTE_FILE%
  ) &gt; %SCRIPT_FILE%
  
  ftp -s:%SCRIPT_FILE% %FTP_HOST%
  del %SCRIPT_FILE%
  
  ENDLOCAL
  </code></pre>
  
  <p>However, when I run this the <code>mget</code> command fails and the following output is given:</p>
  
  <p>Note: the output from the rest of the script shows that all of the previous steps are working as expected. I have even added <code>ls</code> commands to verify the script is in the correct directory.</p>
  
  <pre><code>...
  ftp&gt; mget *.log
  200 Type set to A; form set to N.
  mget logFile1_SystemOut_22-01-13.log? mget logFile2_SystemOut_22-01-13.log? mget 
  logFile3_SystemOut_22-01-13.log? ftp&gt;
  </code></pre>
  
  <p>I have run through this manually repeating the exact same steps and it works fine - no problems and the files are successfully transferred to the C:\Temp directory.</p>
  
  <p>I have checked numerous forums and other websites and I can't see any reason why it should behave like this. Any pointers as to why this doesn't work in the script would be great!</p>
  
  <p>Thanks</p>