title: FTP BAT Script Doesn't work. Goes in a LOOP by itself
body: <p>I have an FTP Script with the following command</p>
  
  <pre><code>FTP -v -i -s: ftpscr.txt
  </code></pre>
  
  <p>The text file ftpscr.txt contains the following:</p>
  
  <pre><code>open 10.195.8.165
  ftp-user
  ftpuser
  cd reports/APSummary
  
  @echo off
  setlocal
  for /f "tokens=2-7 delims=_.-" %%A in ('dir /B TACO_*') do (
    setlocal enabledelayedexpansion
    call :getmonth %%B
    ren TACO*_*%%A-%%B-%%C*_*%%D-%%E-%%F_UTC.csv TACO_%%A!mon!%%C_%%D%%E%%F.csv
    endlocal
  )
  
  
  :getmonth
  if "%1" equ "Jan" set mon=01
  if "%1" equ "Feb" set mon=02
  if "%1" equ "Mar" set mon=03
  if "%1" equ "Apr" set mon=04
  if "%1" equ "May" set mon=05
  if "%1" equ "Jun" set mon=06
  if "%1" equ "Jul" set mon=07
  if "%1" equ "Aug" set mon=08
  if "%1" equ "Sep" set mon=09
  if "%1" equ "Oct" set mon=10
  if "%1" equ "Nov" set mon=11
  if "%1" equ "Dec" set mon=12
  goto :eof
  endlocal
  </code></pre>
  
  <p>When i execute the file ftp.bat which contains the ftp script the command prompt keeps on repeating with no results... Please help</p>