home *** CD-ROM | disk | FTP | other *** search
/ Hall of Fame / HallofFameCDROM.cdr / arc / am432.lzh / PATHINFO.TX < prev    next >
Text File  |  1989-04-27  |  6KB  |  102 lines

  1.  
  2.              INFORMATION ON THE DOS ENVIRONMENT PATH STRING
  3.              ----------------------------------------------
  4.  
  5.           All versions of PC and MS DOS above 2.0 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 ArcMaster) 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.      swithed 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\MYPROG.  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.
  71.  
  72.           ArcMaster depends upon the presence of an archive system's
  73.      executable files (PAK.EXE, ARC.EXE, PKZIP.EXE, etc.). It calls these
  74.      programs by using the command sequence just described and therefore
  75.      cannot function properly unless these programs are in a directory
  76.      specified in the PATH= string.  The simplest thing to do is to place
  77.      your archive system files and LIST.COM in one subdirectory and place
  78.      its DOS path name in the environment.  For example, suppose you are
  79.      using PKWare and you place PKZIP, PKUNXIP, and LIST in a directory
  80.      named C:\ARCUTILS.  Placing the following line in your AUTOEXEC.BAT
  81.      file and rebooting will ensure that ArcMaster will function properly:
  82.  
  83.                              PATH=C:\ARCUTILS
  84.  
  85.      Obviously, the PATH= string can contain other directory path names and 
  86.      you may already have a PATH= command in your AUTOEXEC.BAT file.  If 
  87.      so, just add the directory containing the archive system files to the 
  88.      string.  For maximum speed, make it the first directory name in the 
  89.      string.
  90.           When ArcMaster loads it will check your system environment
  91.      to see if a PATH= string exists.  If so, it will search each
  92.      directory in the string to see if any of the five supported archive
  93.      system files can be found in the directories defined in the PATH.
  94.      If not, or if no path string exists, ArcMaster will display a message
  95.      to that effect and pause. If this occurs, take the steps described
  96.      above and rerun Arcmaster.
  97.  
  98.      NOTE:  It is **important** that DOS 2.x users use CAPS when entering
  99.             path commands into the environment.  DOS 3.x automatically
  100.             changes all characters to upper case but DOS 2.x does not.
  101.  
  102.