@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%
以上是小编为您精心准备的的内容,在的博客、问答、公众号、人物、课程等栏目也有的相关内容,欢迎继续使用右上角搜索按钮进行搜索FTP整站上传
bat批处理脚本命令、bat批处理、bat批处理文件、bat批处理教程、bat批处理命令大全,以便于您获取更多的相关知识。
时间: 2024-11-28 00:02:42