回复 7# nintendoww - @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
复制代码
|