home *** CD-ROM | disk | FTP | other *** search
- bios
- @echo off
- if %1. = . goto usage
- if %1 = ? goto usage
- if %1 = - goto getoldpath
- let %!l = %1
- let %!m = %2
- let %!n = %3
- let %!o = %4
- let %!p = %5
- let %!q = %6
- let %!r = %7
- let %!s = %8
- let %!t = %9
- gosub checkifdisk
- gosub checkforslash
- gosub checkforpath
- gosub checkforroot
- gosub checkfordir
- gosub modify
- gosub displayit
- exit
-
- :checkifdisk
- let %!a = %1
- substring %!a 2 1
- if not %!a = : return
- let %!z = %1
- let %!b = disk
- return
-
- :checkforslash
- if %!b = disk return
- let %!a = %1
- let %!z = %1
- substring %!a 1 1
- if %!a = \ return
- let %!z = \%1
- return
-
- :checkforpath
- let %!a = %path%
- :repeat
- parse %!a %!c ;
- if %!a. = . goto eopath
- if %!z = %!a goto match1
- if %!m = %!a goto match2
- if %!n = %!a goto match3
- if %!o = %!a goto match4
- if %!p = %!a goto match5
- if %!q = %!a goto match6
- if %!r = %!a goto match7
- if %!s = %!a goto match8
- if %!t = %!a goto match9
- let %!a = %!c
- goto repeat
- :eopath
- return
- :match1
- echo Request (%!z) already exists in current path.
- let %!z =
- goto match!
- :match2
- echo Request (%2) already exists in current path.
- let %!m =
- goto match!
- :match3
- echo Request (%3) already exists in current path.
- let %!n =
- goto match!
- :match4
- echo Request (%4) already exists in current path.
- let %!o =
- goto match!
- :match5
- echo Request (%5) already exists in current path.
- let %!p =
- goto match!
- :match6
- echo Request (%6) already exists in current path.
- let %!q =
- goto match!
- :match7
- echo Request (%7) already exists in current path.
- let %!r =
- goto match!
- :match8
- echo Request (%8) already exists in current path.
- let %!s =
- goto match!
- :match9
- echo Request (%9) already exists in current path.
- let %!t =
- :match!
-
- echo Duplication found - Duplicate Removed!
- beep
- goto checkforpath
- exit
-
- :checkforroot
- let %!a = %path%
- getdrive %!d
- if %!z = %d\ return
- if %!z = \ return
- if %2 = %d\ return
- if %2 = \ return
- if %3 = %d\ return
- if %3 = \ return
- if %4 = %d\ return
- if %4 = \ return
- if %5 = %d\ return
- if %5 = \ return
- if %6 = %d\ return
- if %6 = \ return
- if %7 = %d\ return
- if %7 = \ return
- if %8 = %d\ return
- if %8 = \ return
- if %9 = %d\ return
- if %9 = \ return
- :more
- parse %!a %!c ;
- if %!a. = . goto eo2path
- if %!a = %!d\ return
- if %!a = \ return
- let %!a = %!c
- goto more
- :eo2path
- let %!x = Warning: No path to root directory of current drive! (%!d)
- return
-
- :checkfordir
- let %!k = %!z
- let %!c = %2
- let %!d = %3
- let %!e = %4
- let %!f = %5
- let %!g = %6
- let %!h = %7
- let %!i = %8
- let %!j = %9
-
- substring %!k 2 1
- if %!k = : goto skipit
- if not exist %!z\*.* goto dir1notfound
- :skipit
- substring %!c 2 1
- if %!c = : goto skipaa
- if not exist %2\*.* goto dir2notfound
- :skipaa
- substring %!d 2 1
- if %!d = : goto skipbb
- if not exist %3\*.* goto dir3notfound
- :skipbb
- substring %!e 2 1
- if %!e = : goto skipcc
- if not exist %4\*.* goto dir4notfound
- :skipcc
- substring %!f 2 1
- if %!f = : goto skipdd
- if not exist %5\*.* goto dir5notfound
- :skipdd
- substring %!g 2 1
- if %!g = : goto skipee
- if not exist %6\*.* goto dir6notfound
- :skipee
- substring %!h 2 1
- if %!h = : goto skipff
- if not exist %7\*.* goto dir7notfound
- :skipff
- substring %!i 2 1
- if %!i = : goto skipgg
- if not exist %8\*.* goto dir8notfound
- :skipgg
- substring %!j 2 1
- if %!j = : goto skiphh
- if not exist %9\*.* goto dir9notfound
- :skiphh
- if not %!u = x return
- goto emptydir
-
- :dir1notfound
- echo Directory of (%!z) not found -or- empty!
- let %!u = x
- goto skipit
- :dir2notfound
- echo Directory of (%2) not found -or- empty!
- let %!u = x
- goto skipaa
- :dir3notfound
- echo Directory of (%3) not found -or- empty!
- let %!u = x
- goto skipbb
- :dir4notfound
- echo Directory of (%4) not found -or- empty!
- let %!u = x
- goto skipcc
- :dir5notfound
- echo Directory of (%5) not found -or- empty!
- let %!u = x
- goto skipdd
- :dir6notfound
- echo Directory of (%6) not found -or- empty!
- let %!u = x
- goto skipee
- :dir7notfound
- echo Directory of (%7) not found -or- empty!
- let %!u = x
- goto skipff
- :dir8notfound
- echo Directory of (%8) not found -or- empty!
- let %!u = x
- goto skipgg
- :dir9notfound
- echo Directory of (%9) not found -or- empty!
- let %!u = x
- :emptydir
- echo Current path is:
- echo %path%
- beep
- echo
- let %!c =
- let %!d =
- let %!e =
- let %!f =
- let %!g =
- let %!h =
- let %!i =
- let %!j =
- if not %2. = . let %!c = ;%2
- if not %3. = . let %!d = ;%3
- if not %4. = . let %!e = ;%4
- if not %5. = . let %!f = ;%5
- if not %6. = . let %!g = ;%6
- if not %7. = . let %!h = ;%7
- if not %8. = . let %!i = ;%8
- if not %9. = . let %!j = ;%9
- echonolf Do you wish to add (%!z%!c%!d%!e%!f%!g%!i%!j) to your path anyway? (Y/N):
- getkey
- echo
- if errlevel 89 return
- if errlevel 121 return
- exit
-
- :modify
- set oldpath = %path%
-
- if not %!m. = . let %!m = ;%!m
- if not %!n. = . let %!n = ;%!n
- if not %!o. = . let %!o = ;%!o
- if not %!p. = . let %!p = ;%!p
- if not %!q. = . let %!q = ;%!q
- if not %!r. = . let %!r = ;%!r
- if not %!s. = . let %!s = ;%!s
- if not %!t. = . let %!t = ;%!t
-
- set path = %path%;%!z%!m%!n%!o%!p%!q%!r%!s%!t
- return
-
- :displayit
- echo PATH appended to:
- echo PATH = %path%
- if not %!x. = . echo %!x
- return
-
- :usage
- echo Usage: ADDPATH [additional path(s)]
- echo ADDPATH - to return to previous path
- echo Current Path is:
- echo %path%
- exit
-
- :getoldpath
- if %oldpath%. = . goto nooldpath
- set path = %oldpath%
- set oldpath =
- echo Path has been returned to:
- echo %path%
- exit
-
- :nooldpath
- echo No Previous PATH located!
- echo Current Path is:
- echo %path%
- beep
- exit
-