[comp.sys.ibm.pc.misc] Adding to PATH

ts@uwasa.fi (Timo Salmi) (01/20/91)

In article <1991Jan19.174019.20332@mccc.edu> pjh@mccc.edu (Pete Holsberg) writes:
>I would like to be able to either add to the default PATH or replace it
>(with the ability to restore it) via a BAT file, but can't figure out
:

Get /pc/ts/tsbat23.arc from uwasa.fi anonymous ftp archives.  It has
an ADDPATH.BAT batch for appending directories to the path.  It even
checks that the directory exists, and that it has not yet been
appended to the path.  And there is much much more useful batch
programming in there.  If you don't know how to get files from
uwasa.fi, you are welcome to email me for the prerecorded
instructions. 

...................................................................
Prof. Timo Salmi        (Moderating at anon. ftp site 128.214.12.3)
School of Business Studies, University of Vaasa, SF-65101, Finland
Internet: ts@chyde.uwasa.fi Funet: gado::salmi Bitnet: salmi@finfun

cctr132@csc.canterbury.ac.nz (01/21/91)

In article <1991Jan19.174019.20332@mccc.edu>, pjh@mccc.edu (Pete Holsberg)
writes:

> I would like to be able to either add to the default PATH or replace it
> (with the ability to restore it) via a BAT file, but can't figure out
> the syntax.  The following doesn't work:
> 	PATH=%PATH;\added\directory\path
> 	
> If I could do that, I suppose I could also do
> 	OLDPATH=%PATH
> 	PATH=\desired\path\for\the\following\application
> 	invoke_application
> 	PATH=%OLDPATH

I thought you had to *surround* the environment var's name with percent
signs (%) for this kind of thing to work.  Try:

        PATH=%PATH%;\added\directory\path

I'm sure it's in the DOS Manual, but you probably missed it because it's
in the Batch Processing chapter, 8-) (probably - not all OEM DOSes are the
same).

But seriously, this was new with DOS 3.3 (or 3.2?) and won't work with
earlier versions.

---------------------------------------------------------------------------
 Nick FitzGerald, PC Applications Consultant, CSC, Uni of Canterbury, N.Z. 
 Internet: n.fitzgerald@csc.canterbury.ac.nz        Phone: (64)(3) 642-337