windows bat 脚本实现FTP自动下载上传

windows bat 脚本实现FTP自动下载上传

1. 自动下载

# 示例:实现自动下载
@echo Off
echo open 192.168.137.102>>ftp.txt
echo admin>>ftp.txt
echo admin12345>>ftp.txt
echo lcd D:\>>ftp.txt
echo cd /admin/1>>ftp.txt
echo bin>>ftp.txt
echo get 11>>ftp.txt
echo bye>>ftp.txt
ftp -s:ftp.txt

或者使用如下格式

# 准备 ftp.txt 文件
open 192.168.137.102
admin
admin12345
prompt off
lcd D:\
cd /admin/1
bin
mget 11
bye
quit

@echo off
ftp -s:C:\Users\Dxx\Desktop\ftp.txt

2. 自动上传

@echo off
echo open 192.168.137.102>>ftpPut.txt
echo admin>>ftpPut.txt
echo admin12345>>ftpPut.txt
echo lcd D:\ftp>>ftpPut.txt
echo cd admin/1>>ftpPut.txt
echo prompt off>>ftpPut.txt
echo put 12.txt>>ftpPut.txt
echo bye>>ftpPut.txt
echo quit>>ftpPut.txt
ftp -s:ftpPut.txt

 
 
 
 
 

你可能感兴趣的:(Windows,windows,Windows上传下载,自动上传下载)