我有一个带有以下命令的FTP脚本
FTP -v -i -s: ftpscr.txt
文本文件ftpscr.txt包含以下内容:
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
当我执行包含ftp脚本的文件ftp.bat时,命令提示符不断重复,没有结果...请帮助
答案 0 :(得分:0)
您必须将ftp.bat重命名为myftp.bat
并且你的ftp命令在-s参数
之后有一个错误的空格FTP -v -i -s:ftpscr.txt