(view source code of biosinfo.kix as plain text)
; Online help requested?
If $help
Syntax
EndIf
; Connect to computer's WMI service
$objWMIService = GetObject( "winmgmts://./root/cimv2" )
; Display error number and description if applicable
If @ERROR
ShowError()
EndIf
; Collect BIOS information
$colItems = $objWMIService.ExecQuery( "Select * from Win32_BIOS where PrimaryBIOS = true", , 48 )
; Display error number and description if applicable
If @ERROR
ShowError()
EndIf
; To retrieve the BIOS release date we have
; to revert to good old DEBUG techniques
; Create temporary DEBUG script
$kxCrLf = Chr(13) + Chr(10)
$dbg = "D FFFF:0005 L 8" + $kxCrLf + "Q" + $kxCrLf
$rc = RedirectOutput( "biosdate.dbg" )
"$dbg"
$rc = RedirectOutput( "" )
; Run DEBUG script and store output in a temporary file
Shell "DEBUG.EXE < biosdate.dbg > biosdate.dat"
If Open( 3, "biosdate.dat" ) = 0
$line = ReadLine( 3 )
While @Error = 0
$biosdate = $biosdate + SubStr( $line, 67 )
$line = ReadLine(3)
Loop
$rc = Close( 3 )
Else
? "Error reading temporary file, error code: [@Error]"
Syntax
EndIf
; Remove the temporary DEBUG script
Del "biosdate.dat"
Del "biosdate.dbg"
; Display the results
; Header line for screen output
? "BIOS summary for @WkSta:"
; Prepare collected info for display
For Each $objItem in $colItems
? " BIOS Name : " + $objItem.Name
? " Version : " + $objItem.Version
? " Release date : " + $biosdate
? " Manufacturer : " + $objItem.Manufacturer
? " SMBIOS Version : " + $objItem.SMBIOSBIOSVersion
?
Next
; Done
Quit 0
Function ShowError()
? "Error # @ERROR"
?
Syntax
EndFunction
Function Syntax()
? "BIOSInfo.kix, Version 1.00"
? "Display BIOS information for any WMI enabled computer on the network."
?
? "Usage: KIX32 BIOSINFO.KIX [ $$help=1 ]"
?
? "This script uses DEBUG.EXE to read the BIOS release date and WMI for the rest"
?
? "Written by Rob van der Woude"
? "http://www.robvanderwoude.com"
?
; Abort with return code 1
Quit 1
EndFunction
page last modified: 2024-04-16; loaded in 0.0053 seconds