Naviant
888.686.4624

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) has over 20 years of experience in the Information Technology field, which includes 13+ years of Systems Administration and 15+ years of developing and implementing technical documentation and training. She has extensive experience with OnBase, SQL, and a firm foundation in computer science. Despite this, she considers herself a well-adjusted nerd with hobbies including gardening (poorly), 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