REM REM IISLOGMANAGER 1.0 - 25/06/1997 REM REM deletes IIS log files older than a configurable amount of months REM REM directory where IIS logs reside REM absolute or relative path without backslash at the end REM set LOG_DIRECTORY=t REM REM number of months (other than the current) to keep logs of REM can be 1 to 11 REM set MONTHS=1 REM ********** end of customizable part ********** set /a HISTORYLEVEL=MONTHS + 1 REM get date in the form "yymm" for /f "delims=*" %%i in ('date /t') do set DATE=%%i set SHORTDATE=%DATE:~12,2%%DATE:~7,2% set /a HISTORYDATE=SHORTDATE - HISTORYLEVEL REM normalize set MONTH=%HISTORYDATE:~2,2% if /i %MONTH% LEQ 12 goto next set /a HISTORYDATE=HISTORYDATE - 88 :next for %%I in (%LOG_DIRECTORY%\in*.log) do call iislogmanager2 %%I %LOG_DIRECTORY%\in%HISTORYDATE%99.log