Tech Support > Operating Systems > MS-DOS > delete files OLDER than 24 hours
delete files OLDER than 24 hours
Posted by Robert on September 30th, 2004


I need the DOS command to delete files OLDER than 24 hours

please help

thanks


Posted by Matthias Tacke on September 30th, 2004


"Robert" wrote:

are different ways to achieve this.

--
Greetings
Matthias

Posted by Klaus Meinhard on October 1st, 2004


Robert wrote:

This is a nice one for 4DOS. The 4DOS DEL command understands ranges,
date ranges in this case. So the command to delete files older than 1
day would look like

del /[d-1,1/1/80] filespec.ext

for all files created yesterday and older. If you want exactly 24 hours
difference, this gets a little bit longer:

del /[d%@makedate[%@eval[%@date[%_date]-1]]@%_time] filespec.ext

Size, date and time ranges are possible and understood by many commands.

For what 4DOS is and how to get see my 4DOS FAQ.


--
Mit freundlichem Gruß,

Klaus Meinhard



Posted by ghettocow on October 1st, 2004


let's say that your using winxp.. how would u achieve this?

- ghettocow

Posted by Matthias Tacke on October 1st, 2004


ghettocow wrote:

At first by posting in the proper group news:alt.msdos.batch.nt ;-)

with a 3rd party program, I'd take fi.exe from Frank P.Westlake [1]
A cmd-line example:
for /F "delims=" %A in ('FI /B /G">"24/24') do @echo [%~tA] del %A

A solution is also possible with pure batch. See date/time functions
in the batch library from Ritchie Lawrence [2]. (Especially DateToSecs)
But this depends on your locale and date/time formats used.

[1] Frank P. Westlakes utilities : http://gearbox.maem.umr.edu/fwu/
[2] Ritchie Lawrence batch library http://www.commandline.co.uk
--
Greetings
Matthias

Posted by Dr John Stockton on October 1st, 2004


JRS: In article <cjht0u$i8m$1@reader1.panix.com>, dated Thu, 30 Sep
2004 17:17:25, seen in news:alt.msdos.batch, Robert
<rchin@nospampanix.com> posted :
HUNT *.* b#-1 "del" u omit u for test

will delete files dated before yesterday.

NOWMINUS d1 Etwas
HUNT *.* b%twas% "del" u omit u for test

will delete files dated before this time yesterday.

To do reliable 24 hours is appreciably harder, for those who alter the
clocks in Spring and Autumn - if needed, consider NOWMINUS options; it
knows of UK EU & US rules, but you've not stated your country.

HUNT, NOWMINUS free via below.

--
© John Stockton, Surrey, UK. ?@merlyn.demon.co.uk DOS 3.3, 6.20; Win98. ©
Web <URL:http://www.merlyn.demon.co.uk/> - FAQqish topics, acronyms & links.
PAS EXE TXT ZIP via <URL:http://www.merlyn.demon.co.uk/programs/00index.htm>
My DOS <URL:http://www.merlyn.demon.co.uk/batfiles.htm> - also batprogs.htm.

Posted by Richard Bonner on October 2nd, 2004


Robert wrote:
*** If you use the updated XCOPY command called "XXCOPY":

XXCOPY C:\*.* /DB#24H RS /S


That will delete all files on your `C' drive older than 24 hours,
provided your system clock is correct. I don't recommend you do that,
though. (-: Substitute the directory on which you wish to perform this
for "C:\".


An XXCOPY link is in my "DOS Websites" directory at:

http://www.chebucto.ns.ca/~ak621/DOS/Websites.html



Richard Bonner
http://www.chebucto.ns.ca/~ak621/DOS/

Posted by Michael Bednarek on October 2nd, 2004


On Thu, 30 Sep 2004 17:17:25 -0400, "Robert" <rchin@nospampanix.com>
wrote in alt.msdos.batch:

I do this regularly using this command from 4NT:
DEL /[d%@MAKEDATE[%@EVAL[%@DATE[%_date]-1],4]@%_time,1980/1/1] FQP
where FQP is a fully qualified path, like C:\temp\.

4NT's functions MAKEDATE, EVAL, DATE are documented at
<http://jpsoft.com/help/f_makedate.htm> etc.

4NT is a commercial product; however, the same syntax also works for
4DOS which is free at <http://jpsoft.com/download.htm>.

--
Michael Bednarek http://mbednarek.com/ "POST NO BILLS"

Posted by Matthias Tacke on October 2nd, 2004


Richard Bonner wrote:

Fact is:
- the owner and publisher is Pixelab Inc. AFAIK the author Ken Yabumoto
- it is freely downlaodable under a license limiting to peronal use or
otherwise a 60 day evaluation period.
http://www.xxcopy.com/index.htm#freeware

--
Greetings
Matthias

Posted by Richard Bonner on October 4th, 2004


Matthias Tacke wrote:
*** My apologies. I had not thought of my statement as possibly being
taken that way.

Thanks for the correction.

Richard Bonner
http://www.chebucto.ns.ca/~ak621/DOS/




Posted by Bob Davis on October 15th, 2004



"Klaus Meinhard" <K_Meinhard@t-online.de> wrote in message
news:cjit0k$gfc$00$1@news.t-online.com...

Klaus, where is your 4DOS (4NT) FAQ?



Posted by Klaus Meinhard on October 15th, 2004


Bob Davis wrote:

Try here:

--
Klaus Meinhard

Free 4DOS download: http://download.jpsoft.com/4dos/4dos.exe

4DOS Installation FAQ:
http://groups.google.de/groups?hl=de...ine.com&rnum=1



Posted by Bob Davis on October 16th, 2004



"Klaus Meinhard" <K_Meinhard@t-online.de> wrote in message
news:cknoij$oo0$05$1@news.t-online.com...

Where?



Posted by Todd Vargo on October 16th, 2004



"Bob Davis" <iclicknix@cox.net> wrote in message
news:fg%bd.50858$cJ3.48211@fed1read06...
Follow the Google link you snipped.

--
Todd Vargo (double "L" to reply by email)


Posted by Klaus Meinhard on October 16th, 2004


Bob Davis wrote:

It seems that something or other cuts my sig short for you (your email
reader?). Here are the links naked:

Free 4DOS download: http://download.jpsoft.com/4dos/4dos.exe

4DOS Installation FAQ:
http://groups.google.de/groups?hl=de...ine.com&rnum=1


--
Mit freundlichem Gruß,

Klaus Meinhard




Similar Posts