IIS and the W3SVC1 Folder

By default, IIS logs activity to the W3SVC1 folder. This folder can consume a fair amount of disk space over time and eventually interfere with production activity if you don’t trim the log files.

These log files are mainly for troubleshooting and reviewing security, so there is typically no need to keep them indefinitely. Ways to manage them include:

  • Turn on NTFS compression.
  • Zip up older log files.
  • Move older log files to another location.
  • Delete older log files.
  • Turn off logging altogether.

Scripts can be written to handle some of these options for you, such as the following command which assigns a scheduled task to delete log files older than 30 days at midnight on Sundays:

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

Windows 2008
at 12:00 /EVERY:Su Forfiles.exe -p C:\inetpub\logs\LogFiles\W3SVC1 -m *.log -d -30 -c \”Cmd.exe /C del @path\”

(The back slash after the -c flag (…-c \”Cmd.exe…) is required if you want to schedule the FORFILES.EXE command with AT. If you are just running the command on its own, you don’t need the backslash.)

About Jennifer Siegel

Jennifer (aka Pixie), OCI, OCWE, OCWV, has over 20 years of experience in the Information Technology field, which includes 13 years of Systems Administration, 15 years of developing and implementing technical documentation and training, and 10 years supporting OnBase deployments. She has extensive experience with SQL and a firm foundation in computer science. Despite this, she considers herself a well-adjusted nerd with hobbies including archery and knitting in public.

Subscribe to our Newsletter!

We will send you a newsletter once a month with updates from our blog, resource library, and events calendar.

Newsletter Sign Up
Interested to see what ECM can do for your company?
Get in touch with us today to learn more
Contact Us
  Contact Us

Contact Us Today

  • This field is for validation purposes and should be left unchanged.