[comp.os.msdos.misc] AUTOEXEC.BAT question

cs481121@umbc5.umbc.edu (cs481121) (12/08/90)

HELP!  Does anyone out there know if replacable parameters can be used
in the AUTOEXEC.BAT file??  I need to be able to pass a value into the
autoexec of a network workstation at bootup time.  If this sounds
feasible, any and all suggestions will be appreciated.  Thanks.

  Mike Reese -- U.S. Army Information Systems Command

  Please send mail to:  ARPANET - MZR@DETRICK-HSC.ARMY.MIL (26.6.0.54)
                                  REESEM@DETRICK-EMH1.ARMY.MIL (26.5.0.54)

hd7x@vax5.cit.cornell.edu (Sanjay Aiyagari) (12/10/90)

In article <4638@umbc3.UMBC.EDU>,
cs481121@umbc5.umbc.edu (cs481121) writes:
>
> HELP!  Does anyone out there know if replacable parameters can be used
> in the AUTOEXEC.BAT file??  I need to be able to pass a value into the
> autoexec of a network workstation at bootup time.  If this sounds
> feasible, any and all suggestions will be appreciated.  Thanks.
>
>   Mike Reese -- U.S. Army Information Systems Command

Sure! Just have the AUTOEXEC.BAT file call itself with a parameter.  For
example, I run my AUTOEXEC off a RAM disk with the following lines:

echo off
if not !%1==! goto RamDrive
copy c:autoexec.bat e: >nul
e:autoexec @
:RamDrive
REM continue here

By calling AUTOEXEC with a parameter, the batch file knows skip over the
section that copies itself to the RAM drive when it is running from the RAM
drive.
Sanjay Aiyagari (hd7x@vax5.cit.cornell.edu)