本帖最后由 idwma 于 2022-2-25 18:51 编辑
回复 8# 4298728 - @echo off&setlocal enabledelayedexpansion
- cd /d "D:\ToUnicmicro\"
- set ip=192.168.9.89
- set port=21
- set u=test
- set p=Aa4298728
- set fd=/ftp
-
- set cfg=%tmp%\ftp.cfg
- (
- echo open %ip% %port%
- echo %u%
- echo %p%
- echo type binary
- echo mkdir %fd%
- echo cd %fd%
- for /f "delims=" %%i in ('dir /b/s /a-d') do (
- for /f %%j in ("%%~ti") do (
- if "%%j"=="%date:~0,10%" if not "%%~nxi"=="%~nx0" (
- set "d=%%~dpi"
- call set "d=%%d:!cd!=%%"
- if not "!d!"=="!dd!" if not "!d!"=="\" (
- set dd=!d!
- set d=!d:~1,-1!
- set t=
- for /f "delims=" %%a in ('"echo;!d:\=&echo;!"') do (
- set t=!t!/%%a
- echo mkdir "%fd%!t!"
- )
- )
- echo cd "%fd%/!d:\=/!"
- set "d=%%i"
- call set "d=%%d:!cd!\=%%"
- echo put "!d:\=/!"
- )
- )
- )
- echo bye
- )>"%cfg%"
- ftp -i -v -s:"%cfg%"
- del "%cfg%"
- pause
复制代码
|