How to delete IIS log files on a windows 2003 SBS server older than 14 days.
You will need to install the Windows 2003 support tools otherwise you aren’t able to execute the command below. [ note: use the commands below via Notepad otherwise it’s not working because it’s seems like html code or what ]
Forfiles -p C:\WINDOWS\system32\LogFiles\W3SVC1 -s -m *.log -d -14 -c “Cmd /C DEL @File”
Forfiles -p C:\WINDOWS\system32\LogFiles\W3SVC1 -s -m *.log -d -14 -c “Cmd /C ECHO @File”
You could check if the script is working fine. After this you could make a Scheduled Task to run this script automatically .
Save the file was managelog.bat or cmd