首先windows

@echo off
REM 基本配置

REM 远程信息
set remote_ip=%1
set remote_user=%2
set remote_passwd=%3
set remote_mode=%4
set remote_file=%5

set ftptxt=.\ftptxt.ftp
set local_path=d:\ftp

echo open %remote_ip%>%ftptxt%
echo %remote_user%>>%ftptxt%
echo %remote_passwd%>>%ftptxt%
echo bin>>%ftptxt%
echo prompt off>>%ftptxt%
echo lcd %local_path%>>%ftptxt%
echo %remote_mode% %remote_file%>>%ftptxt%
echo bye>>%ftptxt%

ftp -s:"%ftptxt%" 

其次aix/linux

ftp  -i -n 127.0.0.1 <<END
user demo demo
bin
lcd /home/demo
get $zipname
bye
END