我想将文件sample.zip从本地复制到FTP,但在此之前我必须检查FTP文件夹中是否存在带有sample.zip的文件。如果存在则无需执行mput命令(无需复制),下面是我的代码。
@ECHO OFF
echo user FTP003 > ftpcmd.dat
echo KL#!RY169>> ftpcmd.dat
:: change local directory,where sample.zip exist
ECHO LCD "C:\folder1\test">> ftpcmd.dat
:: Change the Remote Directory to copy file
ECHO CD /Releases/Office >> ftpcmd.dat
ECHO PWD >> ftpcmd.dat
ECHO BINARY >> ftpcmd.dat
ECHO prompt >> ftpcmd.dat
:: Need to verify whether sample.zip file exist in this location if exist dont copy, not exist need to copy
echo MPUT sample.zip>> ftpcmd.dat
echo quit>> ftpcmd.dat
ftp -n -s:ftpcmd.dat 182.72.200.181
DEL ftpcmd.dat
请帮助我,我是批处理文件脚本的新手......