home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Supreme Volume 6 #1
/
swsii.zip
/
swsii
/
071
/
ZCM12.ZIP
/
PATHINFO.TXT
< prev
next >
Wrap
Text File
|
1992-02-28
|
4KB
|
78 lines
INFORMATION ON THE DOS ENVIRONMENT PATH STRING
----------------------------------------------
All versions of PC and MS DOS above 1.x maintain an area in
memory called the environment. The environment contains a series of
text strings that are used by DOS and applications programs for
various purposes. You can see what strings are currently in the
enviroment by typing SET and pressing <RETURN> from the DOS level. As
a minimum, the environment will contain the string COMSPEC= followed
by a DOS directory path and (usually) COMMAND.COM. Most hard disk
equipped machines will show the following COMSPEC string:
COMSPEC=C:\COMMAND.COM
Other strings that frequently appear in the environment are the
PROMPT= and PATH= strings. Control of the environment is effected
through the DOS SET command, which may be entered at the DOS level or
from a batch (like AUTOEXEC.BAT) file. For example, if a user desired
that DOS used a copy of COMMAND.COM that was in a directory named
C:\DOS, he/she might place the command SET COMSPEC=C:\DOS\COMMAND.COM
in the AUTOEXEC.BAT file. After booting, DOS would load COMMAND.COM
from C:\DOS each time it needed to reload the command interpreter.
All other copies of COMMAND.COM in the system would be superfluous and
ignored by DOS.
One very useful string that can be placed in the DOS environment
by the user is the PATH= string. When the name of an executable file
is issued from the DOS level, DOS will first look in the current
subdirectory for the file. If it finds it, it loads and executes it
and all is fine. If it cannot find the file in the current directory,
DOS will search the environment for the PATH= designator. If one
exists, DOS will search the directories in the PATH= string for the
executable file. For example, suppose that the AUTOEXEC.BAT contains
the command SET PATH=C:\DOS;D:\UTIL;E:\JUNK. Note that directory path
names are separated by semicolons and can (and should) include the
drive designator. Now further suppose that the user is in a directory
named D:\SOMENAME and desires to run the program MYPROG.EXE but
MYPROG.EXE is not resident in D:\SOMENAME. When the user enters MYPROG,
DOS, unable find it in the current directory, starts searching the
directories in the PATH= string starting with C:\DOS. If MYPROG.EXE
was in D:\UTIL, DOS would load and execute the program and D:\UTIL
would be the active directory when the program received control from
DOS. Obviously, if DOS cannot find MYPROG.EXE in any of directories in
the PATH= string, the message BAD COMMAND OR FILENAME will be
displayed. The exact same sequence is followed if a running program
calls DOS to execute a program.
Each Identifier in the DOS path string MUST be unique. For
example, consider the path identifier C:\UTIL\DOS\MYDIR. Placing
this string in the DOS path string will NOT automatically place the
the dirctories C:\UTIL and C:\UTIL\DOS in the DOS path. Each must
be uniquely identified by the correct path name. For each of these
directories to be identified in the DOS path, the following would
be entered:
C:\UTIL;C:\UTIL\DOS;C:\UTIL\DOS\MYDIR
You may have multiple path strings in your AUTOEXEC.BAT file but
only the last PATH= string is valid. To ensure that you have the path
string the way you want it, type PATH and press "Enter" at the DOS
level. Also, it is important to include the DOS logical drive
specification ("C:" or "D:") with each directory as in the following
example:
PATH=C:\ARCUTILS
Obviously, the PATH= string can contain other directory path names and
you may already have a PATH= command in your AUTOEXEC.BAT file. If
so, just add the directory containing the archive system files to the
string. For maximum speed, make it the first directory name in the
string.
Remember, any time you see the message "Bad command or file name"
it is DOS telling you that you do not have the called program in the
path.