Joe,
A DOS shareware program called XSET can be found at the following address.
http://members.tripod.com/~marcstern/xset.htm
This will allow you to manipulate various variables and perform math from
within batch files. You could store a number in a text file then increment
the number and then append it to the filename. The following is an example:
xset _Maxnumb = 9
xset _Regdate date DDMMYY
xset _Regnumb < _Regnumb.txt
xset /math _Regnumb = %_Regnumb%+1
if %_Regnumb%==%_Maxnumb% xset _Regnumb = 0
echo %_Regnumb% > _Regnumb.txt
xset _Regfile = %_Regdate%%_Regnumb%
Hope this helps,
Joe Trimarchi
-----Original Message-----
From: PCSOFT - Personal Computer software discussion list
[mailto:[log in to unmask]]On Behalf Of Joe Pearson
Sent: Monday, September 14, 1998 1:47 PM
To: [log in to unmask]
Subject: [PCSOFT] batch file - unique file name
Hi all
I want to create a new file in a DOS batch file. How can I ensure the
filename is unique?
Adding the date to a file stub would be enough, like:
COPY EXISTING.FIL NEW%DATE%.FIL
but there does not seem to be any such environment variable.
(Long file names are fine.)
Thanks
Joe
-----
-----
**Need help with PCSOFT mailing list? Send an Email to:**
Bob Wright<[log in to unmask]> or Drew Dunn<[log in to unmask]>
|