Rob van der Woude's Scripting Pages
Powered by GeSHi

Source code for biosdate.bat

(view source code of biosdate.bat as plain text)

  1. @ECHO OFF
  2. ECHO.
  3. ECHO BIOSDate.bat,  Version 1.00 for DOS
  4. ECHO Display BIOS date
  5. ECHO.
  6. ECHO Usage:  %0
  7. ECHO.
  8. ECHO Written by Rob van der Woude
  9. ECHO http://www.robvanderwoude.com
  10. ECHO.
  11. ECHO Idea by ComputerHope
  12. ECHO http://www.computerhope.com/rdebug.htm
  13.  
  14. :: Check if running in true DOS mode
  15. ECHO.%COMSPEC%| FIND /I "COMMAND.COM" >NUL
  16. IF ERRORLEVEL 1 GOTO Error
  17.  
  18. :: Create temporary DEBUG script to read BIOS date
  19. >  BIOSDATE.DBG ECHO D FFFF:0005 L 8
  20. >> BIOSDATE.DBG ECHO Q
  21.  
  22. :: Create temporary batch file to display 8th "word" in a line
  23. >  FFFF.BAT ECHO @ECHO OFF
  24. >> FFFF.BAT ECHO SET BIOSDATE=%%8
  25.  
  26. :: Read BIOS date and store in temporary batch file
  27. ECHO @ECHO OFF> BIOSTEMP.BAT
  28. DEBUG < BIOSDATE.DBG | FIND "/" >> BIOSTEMP.BAT
  29.  
  30. :: Use temporary batch files to parse output from DEBUG script
  31. CALL BIOSTEMP.BAT
  32.  
  33. :: Display the result
  34. ECHO.
  35. ECHO BIOS date: %BIOSDATE%
  36.  
  37. :: Remove temporary files
  38. DEL BIOSTEMP.BAT
  39. DEL BIOSDATE.DBG
  40. DEL FFFF.BAT
  41. GOTO End
  42.  
  43. :Error
  44. ECHO ERROR: This batch file is meant for DOS only!
  45. ECHO.
  46.  
  47. :End
  48.  

page last modified: 2024-04-16; loaded in 0.0047 seconds