Wednesday, June 09, 2010

W3SVC Log Files are Filling Up Your SBS's System Drive

I can't believe that I haven't encountered this sooner:  The system drive on an SBS 2003 was full.  I used my trusty SequoiaView and found that the W3SVC1 folder was 6.14GB - OUCH!  A quick Google search yielded an excellent discussion of how to deal with the matter.

At a command prompt enter this all on one line:

at 12:00 /EVERY:Su Forfiles.exe -p C:\WINDOWS\system32\LogFiles\W3SVC1 -m *.log -d -30 -c "Cmd.exe /C del @path\" 

This will schedule a job that will run every Sunday and remove W3SVC1 log files that are >30 days old.

Thanks to Tom Watson for posting this gem!


Anonymous said...

Can this be applied to any type of file? This command could be very useful.


Anonymous said...


Anonymous said...

Brilliant. TY.