home *** CD-ROM | disk | FTP | other *** search
/ Frostbyte's 1980s DOS Shareware Collection / floppyshareware.zip / floppyshareware / GLEN / 3TIP1.ZIP / 3TIP1.TXT next >
Text File  |  1991-05-28  |  2KB  |  72 lines

  1.       Copyright (c) by Anthony Ng 1991, All rights reserved.
  2.   You are encouraged to distribute this writing and the enclosed batch
  3.   files. Since this is such a small file, it is free.
  4.  
  5. Adding a new path to the enivronment variable PATH normally involves
  6. invoking a editor. Then from inside the editor you load the autoexec.bat
  7. file. Afterwards, you edit the PATH statment "PATH=c:\;c:\dos;..." to
  8. add your new path in. Suppose this is just a temporary new path just for
  9. the current session. What it means is that you have to delete the new
  10. path from the PATH statement after you finish the current session.
  11.  
  12. It is tedious to do this procedure again and again. So here is a short
  13. batch file named npath.bat.  Npath.bat means adding a New path. Included
  14. in this uploaded file is an already typed in version. So the following
  15. code is just for easy reference.
  16.  
  17. ───────────────────────────────────────
  18. @echo off
  19. if "%1"=="" goto SYNTAX
  20. path=%path%;%1
  21. goto END
  22. :SYNTAX
  23. echo npath [pathname]
  24. :END
  25. ───────────────────────────────────────
  26.  
  27. Usage Note:
  28.  
  29. Suppose you want to add a new path named c:\temp, you just type the
  30. following command at the DOS prompt:
  31.  
  32.         npath c:\temp
  33.  
  34. It is not hard to follow the above code. The first line just turns off
  35. the echoing normally accompanying the batch file execution. The second
  36. line checks whether there is an empty parameter. If it does, it echoes
  37. the syntax of npath. The third line appends the new path to the original
  38. path and assigns it to the environment variable path. The fourth line
  39. skips to the END label and quit.
  40.  
  41. Now we finish with the npath.bat. The next step is to design a batch
  42. file to restore the original path when you start up the computer. Here
  43. it requires some forethought. You just add one statement to your
  44. autoexec.bat file. This statement has to be after the PATH statement in
  45. your autoexec.bat. The following is a hypothetical case:
  46.  
  47. @echo off
  48. c:\dos\mouse
  49. path=c:\;c:\dos;c:\wp51;c:\123r3;c:\cad;c:\code
  50. REM Note that you add the following statement after the above PATH
  51. REM statement
  52. set oldpath=path
  53. ...
  54. ...
  55.  
  56. After modifying the autoexec.bat file, please type in the following
  57. code. I have already typed in the code, its name is opath.bat.
  58.  
  59. @echo off
  60. path=%oldpath%
  61.  
  62. Usage Note:
  63.  
  64. It is very simple to restore the original path. Just type in the
  65. following command at the DOS prompt.
  66.  
  67.         oldpath
  68.  
  69.  
  70.  
  71.  
  72.