I am looking for a way to delete all files older than 7 days in a batch file. I\'ve searched around the web, and found some examples with hundreds of lines of code, and oth
Use forfiles.
There are different versions. Early ones use unix style parameters.
My version (for server 2000 - note no space after switches)-
forfiles -p"C:\what\ever" -s -m*.* -d -c"cmd /c del @path"
To add forfiles to XP, get the exe from ftp://ftp.microsoft.com/ResKit/y2kfix/x86/
and add it to C:\WINDOWS\system32