本帖最后由 bailong360 于 2015-7-16 22:07 编辑
问题解决后,请编辑顶楼帖子在标题前面注明[已解决]
http://www.bathome.net/thread-3473-1-1.html- @echo off
- for /f "tokens=1,2,3 delims=/- " %%i in ("%date%") do (
- md temp 2>nul
- copy /y .\%%i%%j%%k\* .\temp
- )
复制代码 放在15424目录下- @echo off
- ::需要调用VBS
-
- REM 指定天数
- set DaysAgo=2
- >"%temp%\MyDate.vbs" echo LastDate=date()-%DaysAgo%
- >>"%temp%\MyDate.vbs" echo FmtDate=right(year(LastDate),4) ^& right("0" ^& month(LastDate),2) ^& right("0" ^& day(LastDate),2)
- >>"%temp%\MyDate.vbs" echo wscript.echo FmtDate
- for /f %%a in ('cscript /nologo "%temp%\MyDate.vbs"') do (
- for /f %%i in ("%%a") do (
- md temp 2>nul
- copy /y .\%%i\* .\temp
- )
- )
复制代码
|