You can create a task that runs daily using Administration> Task Scheduler.
Define a task to run the following command:
forfiles /p "C:\inetpub\logs\LogFiles" /s /m *.* /c "cmd /c Del @path" /d -7
This command is for IIS7, and it deletes all log files that are weeks or older.
You can adjust the number of days by changing the value of /d arg.
Ido Sela May 13 '12 at 20:10 2012-05-13 20:10
source share