home *** CD-ROM | disk | FTP | other *** search
/ PC World 1999 March / PCWorld_1999-03_cd.bin / Software / drivers / y2000 / y2000.exe / SAMPLE.BAT < prev   
DOS Batch File  |  1999-01-15  |  4KB  |  128 lines

  1. @ECHO OFF
  2.  
  3. @REM Batch file support:
  4.  
  5. @REM YMark2000 returns an error level that can be used in batch files.
  6. @REM The error levels returned are:
  7. @REM 
  8. @REM       0 The system is Year 2000 compliant
  9. @REM       1 The hardware clock is not compatible to the MC146818
  10. @REM       2 Progression to the next century is not supported
  11. @REM       3 Progression to the next century is not supported and
  12. @REM         the hardware clock is not compatible to the MC146818
  13. @REM       6 The year 2000 is not supported
  14. @REM       7 The year 2000 is not supported and
  15. @REM         the hardware clock is not compatible to the MC146818
  16. @REM       8 The leap year of 2000 is not supported
  17. @REM      16 The BIOS potentially fails a reboot test.  
  18. @REM         A manual reboot test is highly recommended.
  19. @REM      17 BadRTC & bad reboot BIOS
  20. @REM      18 BadProgression & bad reboot BIOS
  21. @REM      19 BadProgression & BadRTC & bad reboot BIOS
  22. @REM      22 BadY2K & bad reboot BIOS
  23. @REM      23 BadY2K & BadRTC & bad reboot BIOS
  24. @REM      26 BadLeapYear & BadProgression & bad reboot BIOS
  25. @REM      27 BadLeapYear & BadProgression & BadRTC & bad reboot BIOS
  26. @REM 
  27. @REM     255 The program failed to execute.  Either the license agreement was not
  28. @REM         accepted, the RTC is not running, or an unknown command line
  29. @REM         parameter was issued.
  30. @REM 
  31. @REM 
  32. @REM An explanation for the programmers.  Error levels are indicated by bit 
  33. @REM fields.  Since multiple errors can be detected, the sum of the error
  34. @REM bits are returned.  For example, error level 6 (The Year 2000 is not 
  35. @REM supported) is a combination of BadProgression and BadManualSet (2+4).
  36. @REM 
  37. @REM    struct {
  38. @REM      int BadRTC         :1;  // 1, The hardware clock is bad
  39. @REM      int BadProgression :1;  // 2, Progression to 2000 does not occur
  40. @REM      int BadManualSet   :1;  // 4, Cannot manually set 2000
  41. @REM      int BadLeapYear    :1;  // 8, Error in leap year support
  42. @REM      int RebootBIOS     :1;  // 16, BIOS is known to fail reboot tests
  43. @REM      };
  44.  
  45.  
  46. REM  Execute YMark2000
  47. 2000.exe
  48.  
  49. REM  An error code has been returned.
  50. REM  Starting at the highest allowable code, dispatch
  51. REM  to the corresponding result.
  52. if errorlevel == 255 goto Reject
  53. if errorlevel == 16 goto Level16
  54. if errorlevel == 8 goto Level8
  55. if errorlevel == 7 goto Level7
  56. if errorlevel == 6 goto Level6
  57. if errorlevel == 3 goto Level3
  58. if errorlevel == 2 goto Level2
  59. if errorlevel == 1 goto Level1
  60. if errorlevel == 0 goto Level0
  61.  
  62. :Unknown
  63. REM  In theory and practice, the "Unknown Errorlevel" should never be executed
  64. ECHO ******************************
  65. ECHO "UNKNOWN ERRORLEVEL"
  66. ECHO ******************************
  67. GOTO END
  68.  
  69. :Level0
  70. ECHO ******************************
  71. ECHO "Year 2000 Compliant System"
  72. ECHO ******************************
  73. GOTO END
  74.  
  75. :Level1
  76. ECHO ******************************
  77. ECHO "The hardware clock is not compatible to the MC146818"
  78. ECHO ******************************
  79. GOTO END
  80.  
  81. :Level2
  82. ECHO ******************************
  83. ECHO "Real-time progression to the next century is not supported"
  84. ECHO ******************************
  85. GOTO END
  86.  
  87. :Level3
  88. ECHO ******************************
  89. ECHO "Real-time progression to the next century is not supported and the hardware clock is not compatible to the MC146818"
  90. ECHO ******************************
  91. GOTO END
  92.  
  93. :Level6
  94. ECHO ******************************
  95. ECHO "The year 2000 is not supported"
  96. ECHO ******************************
  97. GOTO END
  98.  
  99. :Level7
  100. ECHO ******************************
  101. ECHO "The year 2000 is not supported and the hardware clock is not compatible to the MC146818"
  102. ECHO ******************************
  103. GOTO END
  104.  
  105. :Level8
  106. ECHO ******************************
  107. ECHO "The leap year of 2000 is not supported"
  108. ECHO ******************************
  109. GOTO END
  110.  
  111. :Level16
  112. ECHO ******************************
  113. ECHO "A BIOS that may fail a Y2K reboot test is detected."
  114. ECHO "A manual reboot test is highly recommended."
  115. ECHO ******************************
  116. GOTO END
  117.  
  118.  
  119.  
  120. :Reject
  121. ECHO ******************************
  122. ECHO "The license agreement has been rejected"
  123. ECHO ******************************
  124. GOTO END
  125.  
  126.  
  127. :end
  128.