Delete IIS Log Files Older Than 60 Days

Deletes IIS log files older than 60 days. Syntax: /d -60 = days old. /p = logs reside here.

 
 
 
 
 
(0)
Add to favorites
Servers
8/10/2009
E-mail Twitter del.icio.us Digg Facebook
Sign in to ask a question


  • So simple and works great! With a minor change....
    1 Posts | Last post July 29, 2010
    • forfiles /p %~dp0W3SVC1 /s /m *.log /d -60 /c "%COMSPEC% /c del /q @file"
      
      Tested on Windows Server 2003 SP2.... IIS log files are under c:\windows\system32\logfiles\w3svc1, and we saved the CMD file under c:\windows\system32\logfiles\ (the %~dp0 variable)