Link to home
Start Free TrialLog in
Avatar of Ronoa
Ronoa

asked on

Windows Batch or Script to detect a file date and delete if older than X

Hello,

I'm looking for a script or dos command to detect or return a specified file's modified date, so that I can compare that against a variable, and then delete it if it's older that said variable.
Avatar of johnny_the_knife
johnny_the_knife

Hi Ronoa,

I have written a script which does what you want, it is available at a differant question here: https://www.experts-exchange.com/questions/23140386/Script-to-delete-files.html

Please note, being a file deletion script, it can delete files and you should test it prior to using it in a production environment.

JK
Avatar of Ronoa

ASKER

Hmm.  This is definately a start, however I'm looking to have it delete a specified file, not all of them in the directory.  And by dateModifed, not by dateCreated.  Thanks though, I'll see what I can do to fiddle with this.
ASKER CERTIFIED SOLUTION
Avatar of johnny_the_knife
johnny_the_knife

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