Delete based on dates

Jul 12, 2008
286
0
Las Vegas, NV
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?

Regards,
Chuck Billow
 

Charles Dye

Super Moderator
Staff member
May 20, 2008
4,493
91
Albuquerque, NM
prospero.unm.edu
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.
 
Jul 12, 2008
286
0
Las Vegas, NV
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.

Sigh...

Chuck
 

Charles Dye

Super Moderator
Staff member
May 20, 2008
4,493
91
Albuquerque, NM
prospero.unm.edu
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.

Both work as expected for me. You don't by any chance have an alias for DIR, do you?
 
Similar threads
Thread starter Title Forum Replies Date
A Installers delete EVerything service if already installed Support 0
Chen Touboul When i try to delete an empty folder i got "the dirctoy name is invalid" Support 3
I zip /M fails to delete file after adding to zip file Support 2
D SYNC /W copies back instead of propagating a delete Support 2
M Delete multiple Alternate Datastreams Support 5
D safe delete files command Support 10
P How to? Delete subfolders but not the folder itself Support 11
P Can't do something to a file and then delete it? Support 6
nickles WAD del unable to delete files ending in "." Support 18
gschizas Fixed Cannot use extended path to delete invalid file Support 3
M Can't delete files... Support 8
aedthuio REG ADD/DELETE Support 1
vefatica Cut/delete Support 3
D TCMD16 Delete Toolbar Button bug Support 7
G FOLDERMONITOR created also firing for delete (and maybe other events) Support 7
T How to? Select and Delete text Support 6
Joe Caverly How to? Delete a line from a file Support 4
JohnQSmith How to? Delete descriptions Support 2
vefatica How do I delete "spaces.txt "? Support 21
A How to? Instruct COPY to delete file if only partially copied (via FTP) Support 8
M Why am I unable to delete files? Support 8
R Delete command sets directory attributes to hidden & system Support 46
S 4NT - delete from command prompt and recycle bin Support 12
Phileosophos COPY /W does not delete files in the target Support 4
T Possible to delete the new standard tab? Support 1
P Sync /w won't delete in ftp folder Support 1
M USB based licence? Support 1
C How to? Add date/time to custom tpipe based BTM Support 1
MikeBaas How to? Filter file-contents based on "IF EXIST" Support 6
A How to? Create a date range based upon creation date Support 2
WadeHatler Any way to restore the Text Based "Select File" Windows in TCC Support 2
dcantor How to? Creation and modification dates on one line? Support 2
rps File dates ? Support 2
H Help file pdf dates do not match Support 3

Similar threads