Created
June 10, 2009 16:17
-
-
Save solarce/127318 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment