- @echo off&setlocal enabledelayedexpansion
- set ip=127.0.0.1
- set u=user
- set p=password
- set cfg=ftp.cfg
- (
- echo %u%
- echo %p%
- echo type binary
- )>"%cfg%"
- (for /f "delims=" %%i in ('dir /b/s /a-d') do (
- for /f %%j in ("%%~ti") do (
- if not "%%~nxi"=="%~nx0" if not "%%~nxi"=="%cfg%" if "%%j"=="%date:~0,10%" (
- set "d=%%~dpi"
- call set "d=%%d:!cd!=%%"
- echo mkdir "!d:\=/!"
- echo cd "!d:\=/!"
- set "d=%%i"
- call set "d=%%d:!cd!\=%%"
- echo put "!d:\=/!"
- )
- )
- ))>>"%cfg%"
- echo bye>>"%cfg%"
- ftp -i -v -s:"%cfg%" %ip%
- del "%cfg%"
- pause
复制代码
|