home *** CD-ROM | disk | FTP | other *** search
/ Simtel MSDOS 1992 September / Simtel20_Sept92.cdr / msdos / sysutl / addpath.arc / ADDPATH.DOC < prev   
Text File  |  1987-12-06  |  3KB  |  64 lines

  1.  Addpath.doc by Rick Sattler - 12-06-87 - Portland, Oregon
  2.  
  3.     addpath.bat has been tested and will correctly run
  4.     using DOS 3.0 and on. If you have used the COMMAND.COM
  5.     patches in these libraries, you can remove the "echo off"
  6.     and/or the "cls" commands from this batch file. They are 
  7.     only here for neatness.
  8.  
  9.     I created addpath.bat to assist in expanding the DOS PATH
  10.     variables while I am working with files on my hard disk.
  11.     DOS does not give any easy way to expand this string except
  12.     by typing out the whole thing every time I wanted to make
  13.     a change or addition.
  14.  
  15.     My first clue to any help in this area was reading the new
  16.     DOS 3.2 manuals requarding the previously undocumented
  17.     replaceable parameter signs "% %". By placing an environment
  18.     variable between the two percent signs, it is possible to
  19.     expand on these paramenters and use them in batch files.
  20.     Unmentioned here is that they will only work inside batch
  21.     files.
  22.  
  23.     Hence, the creation of addpath.bat. The first version
  24.     contained no error checking and, if a parameter was not
  25.     specified, added a ";" at the end of the PATH string. This
  26.     was not satisfactory. After much trail and error, the version
  27.     you have now contains simple error checking for times that
  28.     a parameter on the command line is not specified.
  29.  
  30.     The correct syntax for addpath is
  31.  
  32.         addpath [d:][path]
  33.  
  34.     where [d:] is the drive designation
  35.     and [path] is the full pathname to add to the string.
  36.  
  37.     For example, lets say your current PATH string is:
  38.  
  39.     PATH=c:\dos;c:\;c:\batch;c:\utility;d:\turbo
  40.  
  41.     and you want to add your turboc directory "d:\turboc"
  42.     to the string. You could modify the autoexec.bat file and
  43.     reboot. But you don't want this designation permanent. You
  44.     could also type the whole string including the addition at 
  45.     the DOS command line. This can be tedious. Addpath.bat
  46.     lets you add the string simply and without much effort.
  47.     You would simply type:
  48.  
  49.         addpath d:\turboc
  50.  
  51.     Your new PATH string will now look like this:
  52.  
  53.     PATH=c:\dos;c:\;c:\batch;c:\utility;d:\turbo;d:\turboc
  54.  
  55.     Addpath.bat first checks to see if a parameter "%1" has 
  56.     been entered following the name of the file. If not, the
  57.     file "goesto" the "noparm" part of the file that sends
  58.     an error message to the screen. If addpath does find a 
  59.     parameter, it finds the environent string "path" and returns 
  60.     it to the file. Then the file adds a ";" and the new
  61.     path addition to the end of the PATH string and exits.
  62.  
  63.     ENJOY!
  64.