Possible Duplicate:
Batch file to delete files older than N days
I want to run a scheduled windows task that deletes all files from a directory that are older than 2 weeks.
The reason is that these are IIS and Tomcat logs that fill up my server, but I want to keep the most recent logs in case I need to investigate a problem.
Does any one know an easy way to do this?
Cheers
Nige
exact syntax: FORFILES /p d:\new /d -30 /m * /c "cmd /c del @file"