home *** CD-ROM | disk | FTP | other *** search
/ PC Welt 1999 Hardware / PCWExtra.iso / sharewar / pcproble / CMOSSV.EXE / CHKCMOS.BAT < prev    next >
Encoding:
DOS Batch File  |  1998-04-23  |  2.6 KB  |  97 lines

  1. @ECHO OFF
  2. ::REM CHKCMOS.BAT -- ensures CMOS not damaged, repairs if it is.
  3.  
  4. ::REM last updated by Roedy Green of Canadian Mind Products 98/07/23
  5. ::REM Insert to this in AUTOEXEC.BAT to check CMOS.
  6.  
  7. REM Configure this line to point to where you installed the CMP utilities.
  8.  
  9. SET CMPDIR=C:\CMP
  10.  
  11. if not exist  %CMPDIR%\CDD!.com GOTO Missing
  12.  
  13. REM Switch to the C:\CMP drive and directory
  14. %CMPDIR%\CDD!.com %CMPDIR%
  15.  
  16. if not exist  CMOSCHK.COM  GOTO Missing
  17. if not exist  CMOSSAVE.COM GOTO Missing
  18. if not exist  CMOSREST.COM GOTO Missing
  19. if not exist  REBOOT.COM   GOTO Missing
  20. if not exist  NEED.COM     GOTO Missing
  21. if not exist  MD!.COM      GOTO Missing
  22. GoTo KeepGoing
  23.  
  24. :Missing
  25.  
  26. Echo.░▒▓█ Error █▓▒░
  27. Echo The following files must be installed in %CMPDIR%
  28. Echo They are available on BIX or when you register CMOSSAVE.
  29. Echo CDD!.com MD!.com NEED.com REBOOT.com
  30. Echo CMOSCHK.com CMOSSAVE.com and CMOSREST.com.
  31. Echo.
  32. pause
  33. GoTo Done
  34.  
  35. :KeepGoing
  36.  
  37. ::REM  Only bother to check CMOS on the AT-style BIOS, not XT
  38. NEED.COM AT > NUL:
  39. IF Errorlevel 1 GOTO DONE
  40.  
  41. IF NOT EXIST C:\SAFE\CMOS.SAV GoTo MakeIt
  42.  
  43. CMOSCHK.com C:\SAFE\CMOS.SAV /Q
  44. IF NOT Errorlevel 1 GOTO DONE
  45.  
  46. ::REM CMOS check failed:
  47. ::REM could be 2 reasons:
  48.  
  49. ::REM 1. CMOS has been illegitimately tampered with
  50.  
  51. ::REM 2. CMOS has been deliberately changed,
  52. ::REM    Clever user will have to abort, and delete C:\SAFE\CMOS.SAV
  53. ::REM    or delete before before making changes.
  54. ::REM    A new CMOS.SAV will be automatically
  55. ::REM    generated.  It should be copied to the rescue diskette.
  56.  
  57. ::REM Warn consultants confounded by CMOSREST undoing their CMOS changes.
  58.  
  59. Echo.
  60. Echo.To deliberately change CMOS, preferably  B E F O R E  you make
  61. Echo.your CMOS changes, you must delete C:\SAFE\CMOS.SAV.
  62. Echo.You can use ChgCMOS.BAT to do this.
  63. Echo.See CHKCMOS.BAT or CMOS.TXT for more details.
  64. Echo.
  65. Echo.Abort now with Ctrl-Break Y if you do not wish to restore damaged CMOS.
  66. Echo.Normally you should just hit the SPACE BAR to repair CMOS or put it
  67. Echo.back the way it used to be.
  68. Echo.
  69. Pause
  70.  
  71. ::REM save "corrupted" current contents of CMOS just in case
  72. CMOSSAVE.COM C:\SAFE\CMOS.OLD /Q
  73.  
  74. ::REM try restoring
  75. CMOSREST.COM C:\SAFE\CMOS.SAV /Q
  76. IF NOT Errorlevel 1 GOTO Reboot
  77. Echo CMOS is still corrupted
  78. Echo.
  79. Pause
  80.  
  81. :Reboot
  82. Reboot.Com
  83.  
  84. :MakeIt
  85.  
  86. ::REM Build a NEW CMOS.SAV file
  87. Echo Recreating C:\SAFE\CMOS.SAV file.
  88. MD! C:\SAFE
  89. CMOSSAVE.COM C:\SAFE\CMOS.SAV /Q
  90. Echo You might also want to create a new A: Rescue floppy boot disk soon
  91. Echo Use CMOSSAVE A:\CMOS.SAV
  92. Echo.
  93. Pause
  94.  
  95. :DONE
  96. ::REM -30-
  97.