www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/02/25/01:22:18

From: "John M. Aldrich" <fighteer AT cs DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: HELP! Need to write a batch file
Date: Mon, 24 Feb 1997 23:51:33 -0800
Organization: Two pounds of chaos and a pinch of salt
Lines: 27
Message-ID: <33129A05.5020@cs.com>
References: <5etmqt$l6h$1 AT grissom DOT powerup DOT com DOT au>
Reply-To: fighteer AT cs DOT com
NNTP-Posting-Host: ppp225.cs.com
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Craig Bolland wrote:
> 
> I need help writing a simple DOS batch file that creates a file called
> DDMMYY.zip every day, where DD is today's date, MM is the month and YY is
> the year.
> 
> The idea is to have a directory full of little zip files, each being
> automatically named differently, and each containing files updated or
> created during the day. The file will be run by the system at midnight
> every night. Any help would be immensely appreciated. Thanks.

AFAIK, such a "complex" task cannot be done by COMMAND.COM's batch
files.  It's simply beyond the scope of the limited command language. 
At some point, you will have no choice but to use some sort of external
program to generate and read the filenames.

Alternatively, you could try using a Unix-derived shell like 'bash'
(available from SimTel as 'v2gnu/bsh1147.zip'), which does have a
half-decent script language that can easily do what you suggest.

-- 
---------------------------------------------------------------------
| John M. Aldrich, aka Fighteer I  |        fighteer AT cs DOT com         |
|    *  Proud user of DJGPP!  *    |   http://www.cs.com/fighteer   |
|    ObJoke:  If Bill Gates were a robber, not only would he        |
|     shoot you, but he'd send you a bill for the bullets.          |
---------------------------------------------------------------------

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019