批处理自动从FTP服务器下载文件

有时候只能执行命令的时候,需要传文件什么的,可能就需要这样一个批处理来完成这样的功能了。

@echo off
echo 您正在使用的文件来自http://www.zeroplace.cn/
echo 正在建立批处理脚本
echo.
echo o 127.0.0.1 212>s.txt
rem 指定FTP服务器IP地址和端口
echo username>>s.txt
rem 指定用户名
echo password>>s.txt
rem 指定密码
echo lcd G:\KuGou>>s.txt
echo bin>>s.txt
echo get GetVersion.exe>>s.txt
echo bye>>s.txt
echo 开始从服务器下载文件
echo.
ftp -s:s.txt
if exist G:\KuGou\GetVersion.exe (
echo 文件已成功下载到指定目录
echo.
) else (
echo 下载文件失败,请检查设置
echo.
)
del /f /q s.txt>nul
pause 



文章来自: 本站原创
Tags:
评论: 0 | 查看次数: 12406