Monday, August 6, 2007


A very common maintanence task for a file server is to purge files older than a certainly date. For example, to delete all files under a directory that's more than 10 days old.

I'm sure some one can do this in Perl or some other script language in no time. But here is another handy tool for the job: Forfile comes with Windows 2000 Resource Kit and later versions of Windows .Net Servers. It can accomplish that task in just one command, sure beats mingling with date format in a batch file.

One thing to note is that the examples given in that msdn help page don't really work. You need to test things out yourself...