Link to home
Start Free TrialLog in
Avatar of frbou
frbou

asked on

Delete files older than date

Hello,

I need to delete files that are older than a date.
Is there an easy way to do this with a batch file and the desired date as a parameter ?

Thanks.

Fred.
ASKER CERTIFIED SOLUTION
Avatar of SteveGTR
SteveGTR
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Change this line from:

    if not exist _temp_.dat echo del "%%f"

To:

    if not exist _temp_.dat del "%%f"

Actually delete the files.
Avatar of AlertServ
AlertServ

I like a utility called XXCOPY.  It can do exactly what you want without any fuss.  (http://www.xxcopy.com)  
My answer does the trick in a DOS only way.