home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Frostbyte's 1980s DOS Shareware Collection
/
floppyshareware.zip
/
floppyshareware
/
GLEN
/
3TIP1.ZIP
/
3TIP1.TXT
next >
Wrap
Text File
|
1991-05-28
|
2KB
|
72 lines
Copyright (c) by Anthony Ng 1991, All rights reserved.
You are encouraged to distribute this writing and the enclosed batch
files. Since this is such a small file, it is free.
Adding a new path to the enivronment variable PATH normally involves
invoking a editor. Then from inside the editor you load the autoexec.bat
file. Afterwards, you edit the PATH statment "PATH=c:\;c:\dos;..." to
add your new path in. Suppose this is just a temporary new path just for
the current session. What it means is that you have to delete the new
path from the PATH statement after you finish the current session.
It is tedious to do this procedure again and again. So here is a short
batch file named npath.bat. Npath.bat means adding a New path. Included
in this uploaded file is an already typed in version. So the following
code is just for easy reference.
───────────────────────────────────────
@echo off
if "%1"=="" goto SYNTAX
path=%path%;%1
goto END
:SYNTAX
echo npath [pathname]
:END
───────────────────────────────────────
Usage Note:
Suppose you want to add a new path named c:\temp, you just type the
following command at the DOS prompt:
npath c:\temp
It is not hard to follow the above code. The first line just turns off
the echoing normally accompanying the batch file execution. The second
line checks whether there is an empty parameter. If it does, it echoes
the syntax of npath. The third line appends the new path to the original
path and assigns it to the environment variable path. The fourth line
skips to the END label and quit.
Now we finish with the npath.bat. The next step is to design a batch
file to restore the original path when you start up the computer. Here
it requires some forethought. You just add one statement to your
autoexec.bat file. This statement has to be after the PATH statement in
your autoexec.bat. The following is a hypothetical case:
@echo off
c:\dos\mouse
path=c:\;c:\dos;c:\wp51;c:\123r3;c:\cad;c:\code
REM Note that you add the following statement after the above PATH
REM statement
set oldpath=path
...
...
After modifying the autoexec.bat file, please type in the following
code. I have already typed in the code, its name is opath.bat.
@echo off
path=%oldpath%
Usage Note:
It is very simple to restore the original path. Just type in the
following command at the DOS prompt.
oldpath