delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2005/01/15/01:46:30

X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f
X-Trace-PostClient-IP: 68.147.177.20
From: Brian Inglis <Brian DOT Inglis AT SystematicSW DOT Invalid>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Use a Batch file to read update another batch file..
Organization: Systematic Software
Message-ID: <7iehu0lgh1ig7k97jppma70vffkkpni7lq@4ax.com>
References: <1105732650 DOT 055736 DOT 73570 AT c13g2000cwb DOT googlegroups DOT com>
X-Newsreader: Forte Agent 1.93/32.576 English (American)
MIME-Version: 1.0
Lines: 42
Date: Sat, 15 Jan 2005 06:43:12 GMT
NNTP-Posting-Host: 24.71.223.147
X-Complaints-To: abuse AT shaw DOT ca
X-Trace: pd7tw1no 1105771392 24.71.223.147 (Fri, 14 Jan 2005 23:43:12 MST)
NNTP-Posting-Date: Fri, 14 Jan 2005 23:43:12 MST
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

fOn 14 Jan 2005 11:57:30 -0800 in comp.os.msdos.djgpp, "JediKnight2"
<JediKnight2 AT gmail DOT com> wrote:

>What I have are two batch files.  One is an update to the other.
>Problem is that some computers dont use C: some may use D or E.  So
>what I need to do is have my new batch file backup the old batch file,
>easy...then read what the drive letter is that is used and append
>itself or build another batch file that uses the existing drive letter
>with the new commands...
>
>Batch file 1
>
>uses D:
>
>Batch file 2
>
>needs to see that batch file uses d:
>either build another batch file with this info plus the new commands
>OR
>append itself with the appropriate drive letter...

Use bash scripts instead of batch files. 
Failing that, if you insist on continuing to use batch files, and IIRC
from long ago and far away:

insert near start of 1.bat:
: set %DRIVE% and quit if requested
set DRIVE=d:
if "%1" == "quit"

insert into 2.bat:
: returns %DRIVE%
call 1.bat quit
if "%DRIVE%" == "" set DRIVE=c:

if you get the idea.

-- 
Thanks. Take care, Brian Inglis 	Calgary, Alberta, Canada

Brian DOT Inglis AT CSi DOT com 	(Brian[dot]Inglis{at}SystematicSW[dot]ab[dot]ca)
    fake address		use address above to reply

- Raw text -


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