On Tue, 31 Jan 2006 22:12:56 -0500, Ragnar Midtskogen wrote in
microsoft.public.win2000.cmdprompt.admin:
>I have pretty much decided I am going to consolidate several operations and
>modify a VB app I already have written for a different purpose.
>I need to compress the backup files, rename them by embedding a date string,
>then copy them to another server, so I will just use that app to handle the
>deletion too.
I found the problem with developing scripted batch operations using
VB/VBS is their lack of interactivity and difficulty in debugging.
That's why I prefer traditional batch command files.
While recent versions of Microsoft's CMD.EXE feature great improvements
over their predecessors, some of these improvements are syntactically
quite challenging. I decided that my time would be better spent actually
implementing solutions rather than wrestling with CMD's syntax, so I use
4NT as my command line and batch processor.
In your case, deleting files older than five days could look like this:
DEL /[d-5,1/1/1980] DBName_????????.bak
4NT's Date Ranges are documented at
<http://jpsoft.com/help/dateranges.htm>. 4NT is a commercial product;
4DOS, which also knows about Date Ranges (and will run under NT), is
free.
Pure CMD syntax for this operation would be a lot more complicated.
Alternatively, I believe FORFILES.EXE (Resource Kit) can also deal with
date ranges.
--
Michael Bednarek
http://mbednarek.com/ "POST NO BILLS"