Tuesday, October 19, 2010

Delete Old Log Files On Windows

When administrating Windows hosts I always stumble upon stuff which I imagined should be simple, yet proves complex.
I recall I used to write a Perl script in order to delete log files which are older than X days. Today I found out that Windows servers (XP is not a server, so this doesn't work on XP) has this nice "forfiles" command that assists in doing that in a one-liner, as one could've expect.
Have a look here. This works like a charm

1 comment:

  1. The amazing part is that Windows servers do have logs, but I guess they still do not provide vital information on the system ...