nintendoww 当前离线
列兵
BAT-VBS 当前离线
少将
@echo off set DaysAgo=1 >"%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 ( set DstDate=%%a ) "C:\Program Files\WinRAR\WinRAR.exe" a %DstDate%.rar test.txt复制代码
TOP
回复 nintendoww 3楼已经告诉你怎样获得昨天的日期了 BAT-VBS 发表于 2012-12-3 16:54
namejm (闭关中)当前离线
批处理代码写手
荣誉版主
@echo off for /f %%i in ('tad32.exe -1d -f$Y$0m$0d') do set yDay=%%i rar.exe a -n*.txt -n*.doc %yDay%.rar pause复制代码
wjx515 当前离线
上等兵
@echo off ::需要调用VBS rem 指定天数 set DaysAgo=1 >"%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 ( set DstDate=%%a ) echo %DstDate% pause复制代码