/* Initialize variables */ rxCrLf = "0D0A"X /* Check command line argument(s) */ Parse Upper Arg mode If mode <> "" Then Do If mode = "DEBUG" Then debugmode = 1; Else Call Syntax End /* Hide standard error */ "@ECHO OFF" Trace Off /* Get the manufacturer info from the BIOS */ info = GetInfo( "FF00:0000", "FF00:0080" ) If info = "" Then info = GetInfo( "FFF0:0000", "FFF0:0080" ) /* Display the result */ Say Say "BIOS manufacturer : "||info /* Delete temporary DEBUG script */ "DEL biosinfo.dbg >NUL 2>&1" /* Create a new temporary DEBUG script to retrieve the BIOS date */ Call CreateDbg "FFFF:0005 L 8" /* Run DEBUG script and store output in variable */ biosdate = "" address SYSTEM "DEBUG.EXE < biosinfo.dbg | RXQUEUE" Do i = 1 By 1 Until Queued( ) = 0 Parse Pull dbgout /* Debugging info */ If debugmode = 1 Then Say dbgout biosdate = biosdate||SubStr( dbgout, 67 ) End /* Display the result */ Say "BIOS date : "||biosdate /* Delete temporary DEBUG script */ "DEL biosinfo.dbg >NUL 2>&1" /* Normal program termination */ Exit 0 /* Create temporary DEBUG script */ CreateDbg: strDbg = "D "||Arg( 1 )||rxCrLf||"Q"||rxCrLf ret = LineOut( "biosinfo.dbg", strDbg ) If ret <> 0 Then Call Error "Cannot create temporary debug script" ret = LineOut( "biosinfo.dbg" ) Return /* Try to read relevant info from BIOS at specified address */ GetInfo: /* Parse arguments */ adr0 = Arg(1) adr1 = Arg(2) /* Create temporary DEBUG script */ Call CreateDbg adr0||rxCrLf||"D "||adr1 /* Run DEBUG script and concatenate output into a variable */ address SYSTEM "DEBUG.EXE < biosinfo.dbg | RXQUEUE" line = "" Do Until Queued( ) = 0 Parse Pull dbgout /* Debugging info */ If debugmode = 1 Then Say dbgout line = line||SubStr( dbgout, 62 ) End /* Debugging info */ If debugmode = 1 Then Say line /* Remove irrelevant parts of resulting string */ /* Modify minumum required length if necessary */ minlength = 7 newlength = 0 newline = line Do until newlength >= minlength Parse Value newline With string"."newline newlength = Length( string ) End If newlength >= minlength Then line = string; Else line = "" /* Strip whitespace */ line = Strip( line ) /* Return the resulting string */ Return line Syntax: procedure Say Say "BIOSInfo.rex, Version 1.00 for Windows & OS/2" Say "Display BIOS manufacturer and date" Say Say "Usage: BIOSINFO.REX [ DEBUG ]" Say Say 'Where: "DEBUG" will display intermediate results for debugging purposes.' Say Say "This script uses DEBUG.EXE to read the information from BIOS." Say "Tested in Windows 2000 only." Say Say "Written by Rob van der Woude" Say "http://www.robvanderwoude.com" Say Say "Original idea for BIOS date by ComputerHope" Say "http://www.computerhope.com/rdebug.htm" Exit 1 Return