Rob van der Woude's Scripting Pages
Powered by GeSHi

Source code for biosdate.rex

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

  1. /* Read BIOS date from BIOS */
  2.  
  3. /* Display blank line */
  4. Say
  5.  
  6. /* Check for command line parameters (none required) */
  7. Parse Arg strArgs
  8. If strArgs <> "" Then Call Syntax
  9.  
  10. /* Disable unwanted screen output */
  11. "@ECHO OFF"
  12. Trace Off
  13.  
  14. /* Initialize variables */
  15. rxCrLf = X2C( 0D0A )
  16. strDbg = "D FFFF:0005 L 8"||rxCrLf||"Q"
  17.  
  18. /* Define temporary file name */
  19. Parse Source . . strSrc .
  20. filDbg  = SubStr( strSrc, 1, LastPos( ".", strSrc ) ) || "dbg"
  21.  
  22. /* Create temporary Debug script */
  23. Call LineOut filDbg, strDbg
  24. Call LineOut filDbg
  25.  
  26. /* Queue the date read from BIOS using Debug script */
  27. "DEBUG < " || filDbg || " | RXQUEUE"
  28.  
  29. /* Parse the info from the queue */
  30. Do Until Queued( ) = 0
  31. 	Parse Pull strDbg
  32. 	If Length( strDbg ) > 66 Then strBIOS = SubStr( strDbg, 67 )
  33. End
  34.  
  35. /* Close and delete temporary Debug script */
  36. Call LineOut filDbg
  37. "DEL " || filDbg || " > NUL"
  38.  
  39. /* Display result */
  40. Say "BIOS date: "||strBIOS
  41.  
  42. /* Normal program termination */
  43. Exit 0
  44.  
  45.  
  46. Syntax:
  47. 	Say "BIOSDate.rex,  Version 1.00"
  48. 	Say "Display BIOS date"
  49. 	Say
  50. 	Say "Usage:  <REXX>  BIOSDATE.REX"
  51. 	Say
  52. 	Say 'Where:  "<REXX>" is your Rexx interpreter:'
  53. 	Say "                 - Windows:  REGINA.EXE or REXX.EXE, whichever you installed"
  54. 	Say "                             (tested with Regina Rexx only!)"
  55. 	Say "                 - OS/2:     no need to specify, just rename script to *.cmd"
  56. 	Say
  57. 	Say "This Rexx script uses DEBUG.EXE to read the date from the BIOS"
  58. 	Say
  59. 	Say "Written by Rob van der Woude"
  60. 	Say "http://www.robvanderwoude.com"
  61. 	Say
  62. 	Say "Original idea by ComputerHope"
  63. 	Say "http://www.computerhope.com/rdebug.htm"
  64. 	Exit 1
  65. Return
  66.  

page last uploaded: 2017-04-06, 13:33