home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-387-Vol-3of3.iso / n / nt_drv.exe / COPYDRV.BAT < prev    next >
DOS Batch File  |  1993-02-10  |  888b  |  42 lines

  1. @echo off
  2.  
  3. if not exist %_DRIVER% goto ENoDrv
  4.  
  5. REM Remove the potential backup file (second installation)
  6. if not exist %_DRVDIR%\%_DRVBAK% goto LNext1
  7. del %_DRVDIR%\%_DRVBAK% > NUL
  8. if not errorlevel 0 goto ENoDel
  9.  
  10. REM Rename the current driver so that we can copy the new one.
  11. :LNext1
  12. if not exist %_DRVDIR%\%_DRIVER% goto LNext2
  13. ren %_DRVDIR%\%_DRIVER% %_DRVBAK% > NUL
  14. if not errorlevel 0 goto ENoRename
  15.  
  16. :LNext2
  17. copy %_DRIVER% %_DRVDIR%\%_DRIVER% > NUL
  18. if not errorlevel 0 goto ECantCopy
  19.  
  20.  
  21. REM We successfully installed the file.
  22. echo %_DRIVER% driver copied.
  23. goto End
  24.  
  25. :ENoDel
  26. echo ERROR: Cannot delete the %_DRVBAK% file.
  27. goto End
  28.  
  29. :ENoRename
  30. echo ERROR: Cannot rename the %_DRIVER% file.
  31. goto End
  32.  
  33. :ENoDrv
  34. echo ERROR: Cannot find the source %_DRIVER% driver
  35. goto End
  36.  
  37. :ECantCopy
  38. echo ERROR: Unable to copy the %_DRIVER% driver
  39. goto End
  40.  
  41. :End
  42.