Path: utzoo!utgpu!water!watmath!clyde!att!osu-cis!killer!ames!pasteur!agate!violet.berkeley.edu!swillett
From: swillett@violet.berkeley.edu
Newsgroups: comp.sys.ibm.pc
Subject: Re: How to add to PATH on the fly?
Message-ID: <11370@agate.BERKELEY.EDU>
Date: 26 Jun 88 05:47:56 GMT
References: <688@crcmar.crc.uucp> <4591@killer.UUCP>
Sender: usenet@agate.BERKELEY.EDU
Organization: University of California, Berkeley
Lines: 28

My approach is to create an environment variable called NPATH in the
autoexec.bat file:

set NPATH=%PATH%

after I have created my default path.  I also have two batch files
which I keep in a directory which is in my default path (UTIL):

NSAVPATH.BAT
   SET NPATH=%PATH%
   PATH = %PATH%;%1

OLDPATH.BAT
   PATH=%NPATH%

I use the first as 

   NSAVPATH d:\workdir 

to create a new path while saving my old path and then I recall my old path

   OLDPATH
 
You can still use PATH to create an entirely new path and then use OLDPATH
to restore the last path you saved to NPATH (like your default if you have
not used NSAVPATH.