快活林资源网 Design By www.csstdc.com
@echo off
rem 设置FTP服务器地址
set ftpIP=192.168.0.2
rem 设置FTP用户名
set ftpUser=MyUser
rem 设置FTP密码
set ftpPass=MyPass
rem 设置待上传的本地文件夹目录
set UpFolder=C:/test

rem 生成待上传的本地文件夹列表
type nul>%temp%/FolderList.txt
for /r "%UpFolder%" %%a in (.) do (
  set FullName=%%a
  setlocal enabledelayedexpansion
  set FolderName=!FullName:%UpFolder%=!
  set FolderName=!FolderName:~1,-2!
  echo,!FolderName!%temp%/FolderList.txt
  endlocal
)
>"%temp%/ftpFile.txt" echo,%ftpUser%
"%temp%/ftpFile.txt" echo,%ftpPass%
"%temp%/ftpFile.txt" echo bin
"%temp%/ftpFile.txt" (
  for /f "usebackq tokens=*" %%a in ("%temp%/FolderList.txt") do (
    echo cd /
    echo mkdir "%%a"
    echo cd "/%%a"
    echo mput "%UpFolder%/%%a/*.*"
  )
)
"%temp%/ftpFile.txt" echo ! rd /s /q "%UpFolder%"
"%temp%/ftpFile.txt" echo ! md "%UpFolder%"
"%temp%/ftpFile.txt" echo bye
ftp -v -i -s:"%temp%/ftpFile.txt" %ftpIP%
快活林资源网 Design By www.csstdc.com
广告合作:本站广告合作请联系QQ:858582 申请时备注:广告合作(否则不回)
免责声明:本站资源来自互联网收集,仅供用于学习和交流,请遵循相关法律法规,本站一切资源不代表本站立场,如有侵权、后门、不妥请联系本站删除!
快活林资源网 Design By www.csstdc.com