Mail Archives: djgpp/2005/01/16/22:00:52
On Sat, 15 Jan 2005 06:43:12 GMT in comp.os.msdos.djgpp, Brian Inglis
<Brian DOT Inglis AT SystematicSW DOT Invalid> wrote:
>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"
goto end
...
:end
>
>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 -