Delete based on dates

  • This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.
How would I set up a batch file that would delete all files / folders older than, say, two days?

I use ERUNT as a registry backup, but, because I append the time to the end of the folder name, AUTOBACK cannot do the delete on any older than "x."

As of right now ERUNT is set up to create folders in the following format:

dd_mm_yy, hh:mm:ss

Is there a way to have TCC do this? Would it use the timestamp instead of the name?

Chuck Billow

Charles Dye

Super Moderator
Staff member
May 20, 2008
Albuquerque, NM
See HELP DATERANGES for information on, well, date ranges.

And also note that DEL supports a handy /N option, which means "don't really delete". You can test your command using /N and, once you're sure it's working as you expect, remove the /N to actually do the dirty deed.
Charles, I know I'm doing something wrong that should be obvious, but...

I tried using the dir command, like dir /[d-3,1980-1-1] and dir /[d-3]

but in both cases I got listings for all the files in the folder -- even today's.