__wmi_Win32_BIOS()
Func __wmi_Win32_BIOS()
Local $wbemFlagReturnImmediately = 0x10
Local $wbemFlagForwardOnly = 0x20
Local $colItems = ""
Local $strComputer = "localhost"
Local $Output=""
$Output &= "Computer: " & $strComputer & @CRLF
$Output &= "==========================================" & @CRLF
Local $objWMIService = ObjGet("winmgmts:\" & $strComputer & "\root\CIMV2")
$colItems = $objWMIService.ExecQuery("SELECT * FROM Win32_BIOS", "WQL", _
$wbemFlagReturnImmediately + $wbemFlagForwardOnly)
If IsObj($colItems) then
For $objItem In $colItems
Local $strBiosCharacteristics = $objItem.BiosCharacteristics(0)
$Output &= "BiosCharacteristics: " & $strBiosCharacteristics & @CRLF
Local $strBIOSVersion = $objItem.BIOSVersion(0)
$Output &= "BIOSVersion: " & $strBIOSVersion & @CRLF
$Output &= "BuildNumber: " & $objItem.BuildNumber & @CRLF
$Output &= "Caption: " & $objItem.Caption & @CRLF
$Output &= "CodeSet: " & $objItem.CodeSet & @CRLF
$Output &= "CurrentLanguage: " & $objItem.CurrentLanguage & @CRLF
$Output &= "Description: " & $objItem.Description & @CRLF
$Output &= "IdentificationCode: " & $objItem.IdentificationCode & @CRLF
$Output &= "InstallableLanguages: " & $objItem.InstallableLanguages & @CRLF
$Output &= "InstallDate: " & WMIDateStringToDate($objItem.InstallDate) & @CRLF
$Output &= "LanguageEdition: " & $objItem.LanguageEdition & @CRLF
Local $strListOfLanguages = $objItem.ListOfLanguages(0)
$Output &= "ListOfLanguages: " & $strListOfLanguages & @CRLF
$Output &= "Manufacturer: " & $objItem.Manufacturer & @CRLF
$Output &= "Name: " & $objItem.Name & @CRLF
$Output &= "OtherTargetOS: " & $objItem.OtherTargetOS & @CRLF
$Output &= "PrimaryBIOS: " & $objItem.PrimaryBIOS & @CRLF
$Output &= "ReleaseDate: " & WMIDateStringToDate($objItem.ReleaseDate) & @CRLF
$Output &= "SerialNumber: " & $objItem.SerialNumber & @CRLF
$Output &= "SMBIOSBIOSVersion: " & $objItem.SMBIOSBIOSVersion & @CRLF
$Output &= "SMBIOSMajorVersion: " & $objItem.SMBIOSMajorVersion & @CRLF
$Output &= "SMBIOSMinorVersion: " & $objItem.SMBIOSMinorVersion & @CRLF
$Output &= "SMBIOSPresent: " & $objItem.SMBIOSPresent & @CRLF
$Output &= "SoftwareElementID: " & $objItem.SoftwareElementID & @CRLF
$Output &= "SoftwareElementState: " & $objItem.SoftwareElementState & @CRLF
$Output &= "Status: " & $objItem.Status & @CRLF
$Output &= "TargetOperatingSystem: " & $objItem.TargetOperatingSystem & @CRLF
$Output &= "Version: " & $objItem.Version & @CRLF
if Msgbox(1,"WMI Output",$Output) = 2 then ExitLoop
$Output=""
Next
Else
Msgbox(0,"WMI 输出","没有在类 " & "Win32_BIOS" & "中找到WMI对象" )
Endif
EndFunc
Func WMIDateStringToDate($dtmDate)
Return (StringMid($dtmDate, 5, 2) & "/" & _
StringMid($dtmDate, 7, 2) & "/" & StringLeft($dtmDate, 4) _
& " " & StringMid($dtmDate, 9, 2) & ":" & StringMid($dtmDate, 11, 2) & ":" & StringMid($dtmDate,13, 2))
EndFunc
|