www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/02/25/04:41:13

Date: Tue, 25 Feb 1997 11:35:11 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: Craig Bolland <craig AT powerup DOT com DOT au>
cc: djgpp AT delorie DOT com
Subject: Re: HELP! Need to write a batch file
In-Reply-To: <5etmqt$l6h$1@grissom.powerup.com.au>
Message-ID: <Pine.SUN.3.91.970225112955.6964C-100000@is>
MIME-Version: 1.0

On 25 Feb 1997, 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.

Are you sure a simple C program isn't what you need?  You can spawn PKZIP 
from it after constructing the command line.

If you somehow need to do it with a batch file, it's possible, but 
tricky.  You write a batch file which does this:

	1) Writes the date to a file (DOS `date' won't work, because it 
cannot be redirected, but GNU `date' from Sh-utils will).  Let's call 
this file DATE.DAT.

	2) Calls Sed to edit the contents of DATE.DAT into a batch file 
which will call PKZIP with the command-line you need .

	3) Calls the second batch file.

- Raw text -


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