Rar方式压缩旧文件再删除(XP Win200通用)
@echo off
regedit /e "%temp%\bak.reg" "HKEY_CURRENT_USER\Control Panel\International"
>aDate.reg echo REGEDIT4
>>aDate.reg echo.
>>aDate.reg echo
>>aDate.reg echo "sShortDate"="yyyy-MM-dd"
>>aDate.reg echo "sDate"="-"
>tmp.vbs echo Wscript.echo FormatDateTime (DateAdd("d",-7,Date),2)
for /f "delims=" %%i in ('cscript.exe //nologo tmp.vbs') do set aDate=%%i
del tmp.vbs
"%ProgramFiles%\WinRAR\rar.exe" a -ep2 -df -r -tb%aDate% "xxx.rar" "xxx\*"
regedit /s aDate.reg
del aDate.reg
pause