home *** CD-ROM | disk | FTP | other *** search
/ Current Shareware 1994 January / SHAR194.ISO / zm30 / pathinfo.txt < prev    next >
Text File  |  1993-01-06  |  6KB  |  101 lines

  1.  
  2.              INFORMATION ON THE DOS ENVIRONMENT PATH STRING
  3.              ----------------------------------------------
  4.  
  5.         All versions of PC and MS DOS above 1.x maintain an area in
  6.    memory called the environment.  The environment contains a series of
  7.    text strings that are used by DOS and applications programs for
  8.    various purposes.  You can see what strings are currently in the
  9.    enviroment by typing SET and pressing <RETURN> from the DOS level.  As
  10.    a minimum, the environment will contain the string COMSPEC= followed
  11.    by a DOS directory path and (usually) COMMAND.COM.  Most hard disk
  12.    equipped machines will show the following COMSPEC string:
  13.  
  14.                        COMSPEC=C:\COMMAND.COM
  15.  
  16.         Other strings that frequently appear in the environment are the
  17.    PROMPT= and PATH= strings.  Control of the environment is effected
  18.    through the DOS SET command, which may be entered at the DOS level or
  19.    from a batch (like AUTOEXEC.BAT) file.  For example, if a user desired
  20.    that DOS used a copy of COMMAND.COM that was in a directory named
  21.    C:\DOS, he/she might place the command SET COMSPEC=C:\DOS\COMMAND.COM
  22.    in the AUTOEXEC.BAT file.  After booting, DOS would load COMMAND.COM
  23.    from C:\DOS each time it needed to reload the command interpreter.
  24.    All other copies of COMMAND.COM in the system would be superfluous and
  25.    ignored by DOS.
  26.         One very useful string that can be placed in the DOS environment
  27.    by the user is the PATH= string.  When the name of an executable file
  28.    is issued from the DOS level, DOS will first look in the current
  29.    subdirectory for the file.  If it finds it, it loads and executes it
  30.    and all is fine.  If it cannot find the file in the current directory,
  31.    DOS will search the environment for the PATH= designator.  If one
  32.    exists, DOS will start searching the system directories that are in the
  33.    PATH= string for the executable file.  For example, suppose that
  34.    the AUTOEXEC.BAT contains the command SET PATH=C:\DOS;D:\UTIL;E:\JUNK.
  35.    Note that directory path names are separated by semicolons and can
  36.    (and should) include the drive designator.  Now further suppose that
  37.    the user is in a directory named D:\SOMENAME and desires to run the
  38.    program MYPROG.EXE but MYPROG.EXE is not resident in D:\SOMENAME.
  39.    When the user enters MYPROG, DOS, unable find it in the current
  40.    directory, starts searching the directories in the PATH= string
  41.    starting with C:\DOS.  If MYPROG.EXE was in D:\UTIL, DOS would load
  42.    and execute the program and D:\UTIL would be the active directory when
  43.    the program received control from DOS.  Obviously, if DOS cannot find
  44.    MYPROG.EXE in any of directories in the PATH= string, the message BAD
  45.    COMMAND OR FILENAME will be displayed.
  46.         The exact same sequence is followed if a running program calls
  47.    DOS to execute a program but with one possible important difference.
  48.    For technical reasons, some programs (like ZipMaster) need to load a
  49.    secondary copy of COMMAND.COM and then pass the name of the program to
  50.    be executed to COMMAND.COM.  This is accomplished by searching the
  51.    environment string for the COMSPEC= string to locate COMMAND.COM,
  52.    changing to that directory, and telling DOS to load COMMAND.COM.  The
  53.    command passed to DOS might look somethin like this:
  54.  
  55.                          COMMAND.COM MYPROG.EXE
  56.  
  57.    This tells DOS to run COMMAND.COM and for COMMAND.COM to load and
  58.    execute MYPROG.EXE.  Even if MYPROG.EXE were located in the active
  59.    directory when the applications program passed this command to DOS,
  60.    COMMAND.COM might not find MYPROG.EXE because the applications program
  61.    switched to the directory where COMMAND.COM was located in order to
  62.    start things rolling.  Therefore, unless MYPROG.EXE was in a directory
  63.    contained in the PATH= string or in the same directory as COMMAND.COM,
  64.    DOS would not find it.
  65.  
  66.         Each Identifier in the DOS path string MUST be unique.  For
  67.    example, consider the path identifier C:\UTIL\DOS\MYDIR.  Placing
  68.    this string in the DOS path string will NOT automatically place the
  69.    the dirctories C:\UTIL and C:\UTIL\DOS in the DOS path.  Each must
  70.    be uniquely identified by the correct path name.  For each of these
  71.    directories to be identified in the DOS path, the following would
  72.    be entered:
  73.  
  74.                     C:\UTIL;C:\UTIL\DOS;C:\UTIL\DOS\MYDIR
  75.  
  76.         ZipMaster depends upon the presence of an archive system's
  77.    executable files (PKZIP.EXE, PKUNZIP.EXE, etc.). It calls these
  78.    programs by using the command sequence just described and therefore
  79.    cannot function properly unless these programs are in a directory
  80.    specified in the PATH= string.  The simplest thing to do is to place
  81.    your archive system files and LIST.COM in one subdirectory and place
  82.    its DOS path name in the environment.  For example, suppose you are
  83.    using PKWare and you place PKZIP, PKUNXIP, and LIST in a directory
  84.    named C:\ARCUTILS.  Placing the following line in your AUTOEXEC.BAT
  85.    file and rebooting will ensure that ZipMaster will function properly:
  86.  
  87.                            PATH=C:\ARCUTILS
  88.  
  89.    Obviously, the PATH= string can contain other directory path names and
  90.    you may already have a PATH= command in your AUTOEXEC.BAT file.  If
  91.    so, just add the directory containing the archive system files to the
  92.    string.  For maximum speed, make it the first directory name in the
  93.    string.
  94.  
  95.         When ZipMaster loads it will check your system environment
  96.    to see if a PATH= string exists.  If so, it will search each
  97.    directory in the string to see if any of the supported archive
  98.    system files can be found in the directories defined in the PATH.
  99.  
  100.  
  101.