home *** CD-ROM | disk | FTP | other *** search
- @echo off^goto start
- :help
- echo.
- echo %@upper[%0] -- Adds given path to the PATH variable.
- echo.
- echo Usage: %@upper[%0] `<`path`>`
- echo.
- echo Given path is added as the first path in the `%`PATH variable.
- echo Parameter must be an existing directory not in `%`PATH yet.
- echo See also DELPATH.
- return
-
- :start
- if "%debug" eq "%0" echo on
- if "%1" eq "" .or. "%1" eq "/?" (gosub help^quit 0)
-
- iff isdir %1 then
- iff %@index[%path%;,%@full[%1];] eq -1 then
- set path=%@full[%1];%path
- quit 0
- else
- if %_batch eq 1 echo %@upper[%0]: Directory %@full[%1] already in `%`PATH!
- quit 0
- endiff
- else
- if %_batch eq 1 echo %@upper[%0]: Invalid directory "%1"
- quit 1
- endiff
-