Script to clean out log files, or any files in a directory based on date

 

 

If you only want one week, change the file age to 7. Or, if you want 90 days, then change it to 90.

The paths to clean specified in this example are meant to be changes and you dont have to use subdirectories, and\or you could use more subdirectories.

**Works great for cleaning out log directories for IIS

Cheers,

Leave a Reply