echo off
rem %1 - path %2- mask %3 - archive name %4 - days old
if "%~1"=="" goto usage
if "%~3"=="" goto usage
forfiles /p "%~1" /m "%~2" /d -%~4 /c "cmd /c echo @file @fdate @ftime & 7za a %~3.7z @file && del /f /q @file"
goto quit
:usage
echo pack all files in path %%1 by mask %%2 with %%4 days old
echo to archive %%3.zip (for dated archive name use %%date:~8,2%%%%date:~3,2%%%%date:~0,2%%)
:quit
|