#comments-start Name: _BIOS UDF Purpose: Get informations from the BIOS Autor: campweb Note: Every Function returns a String Functions: _BIOS_GetCharacteristics() _BIOS_GetVersion() _BIOS_GetVersionVersion() _BIOS_GetBuild() _BIOS_GetCaption() _BIOS_GetCodeSet() _BIOS_GetCustomLanguage() _BIOS_GetDescription() _BIOS_GetIdentificationCode() _BIOS_GetStatus() _BIOS_GetReleaseDate() _BIOS_GetManufacturer() _BIOS_GetName() _BIOS_GetSerialNumber() _BIOS_GetInstallDate() #comments-end ; _BIOS_GetVersionVersion() ; Returns a String containing the 2. Version of the BIOS ; Failure: Sets @error to non-0 and returns -1 Func _BIOS_GetVersionVersion() $objWMIService = ObjGet("winmgmts:\\localhost\") $colItems = $objWMIService.ExecQuery("SELECT * FROM Win32_BIOS", "WQL", _ 0x10 + 0x20) If Not IsObj($colItems) Then SetError(1, 1, 1) Return -1 Else For $objItem In $colItems Return $objItem.Version Next EndIf EndFunc ; _BIOS_GetStatus() ; Returns a String containing the Status of the BIOS ; Failure: Sets @error to non-0 and returns -1 Func _BIOS_GetStatus() $objWMIService = ObjGet("winmgmts:\\localhost\") $colItems = $objWMIService.ExecQuery("SELECT * FROM Win32_BIOS", "WQL", _ 0x10 + 0x20) If Not IsObj($colItems) Then SetError(1, 1, 1) Return -1 Else For $objItem In $colItems Return $objItem.Status Next EndIf EndFunc ; _BIOS_GetReleaseDate() ; Returns a String containing the Release Date of the BIOS ; Failure: Sets @error to non-0 and returns -1 Func _BIOS_GetReleaseDate() $objWMIService = ObjGet("winmgmts:\\localhost\") $colItems = $objWMIService.ExecQuery("SELECT * FROM Win32_BIOS", "WQL", _ 0x10 + 0x20) If Not IsObj($colItems) Then SetError(1, 1, 1) Return -1 Else For $objItem In $colItems Return WMIDateStringToDate($objItem.ReleaseDate) Next EndIf EndFunc ; _BIOS_GetName() ; Returns a String containing the Name of the BIOS ; Failure: Sets @error to non-0 and returns -1 Func _BIOS_GetName() $objWMIService = ObjGet("winmgmts:\\localhost\") $colItems = $objWMIService.ExecQuery("SELECT * FROM Win32_BIOS", "WQL", _ 0x10 + 0x20) If Not IsObj($colItems) Then SetError(1, 1, 1) Return -1 Else For $objItem In $colItems Return $objItem.Name Next EndIf EndFunc ; _BIOS_GetManufacturer() ; Returns a String containing the Manufacturer of the BIOS ; Failure: Sets @error to non-0 and returns -1 Func _BIOS_GetManufacturer() $objWMIService = ObjGet("winmgmts:\\localhost\") $colItems = $objWMIService.ExecQuery("SELECT * FROM Win32_BIOS", "WQL", _ 0x10 + 0x20) If Not IsObj($colItems) Then SetError(1, 1, 1) Return -1 Else For $objItem In $colItems Return $objItem.Manufacturer Next EndIf EndFunc ; _BIOS_GetSerialNumber() ; Returns a String containing the Serial Number of the BIOS ; Failure: Sets @error to non-0 and returns -1 Func _BIOS_GetSerialNumber() $objWMIService = ObjGet("winmgmts:\\localhost\") $colItems = $objWMIService.ExecQuery("SELECT * FROM Win32_BIOS", "WQL", _ 0x10 + 0x20) If Not IsObj($colItems) Then SetError(1, 1, 1) Return -1 Else For $objItem In $colItems Return $objItem.SerialNumber Next EndIf EndFunc ; _BIOS_GetInstallDate() ; Returns a String containing the Install Date of the BIOS ; Failure: Sets @error to non-0 and returns -1 Func _BIOS_GetInstallDate() $objWMIService = ObjGet("winmgmts:\\localhost\") $colItems = $objWMIService.ExecQuery("SELECT * FROM Win32_BIOS", "WQL", _ 0x10 + 0x20) If Not IsObj($colItems) Then SetError(1, 1, 1) Return -1 Else For $objItem In $colItems Return WMIDateStringToDate($objItem.InstallDate) Next EndIf EndFunc ; _BIOS_GetIdentifiactionCode() ; Returns a String containing the Identification Code of the BIOS ; Failure: Sets @error to non-0 and returns -1 Func _BIOS_GetIdentificationCode() $objWMIService = ObjGet("winmgmts:\\localhost\") $colItems = $objWMIService.ExecQuery("SELECT * FROM Win32_BIOS", "WQL", _ 0x10 + 0x20) If Not IsObj($colItems) Then SetError(1, 1, 1) Return -1 Else For $objItem In $colItems Return $objItem.IdentificationCode Next EndIf EndFunc ; _BIOS_GetDescription() ; Returns a String containing the Description of the BIOS ; Failure: Sets @error to non-0 and returns -1 Func _BIOS_GetDescription() $objWMIService = ObjGet("winmgmts:\\localhost\") $colItems = $objWMIService.ExecQuery("SELECT * FROM Win32_BIOS", "WQL", _ 0x10 + 0x20) If Not IsObj($colItems) Then SetError(1, 1, 1) Return -1 Else For $objItem In $colItems Return $objItem.Description Next EndIf EndFunc ; _BIOS_GetCustomLanguage() ; Returns a String containing the Language of the BIOS ; Failure: Sets @error to non-0 and returns -1 Func _BIOS_GetCustomLanguage() $objWMIService = ObjGet("winmgmts:\\localhost\") $colItems = $objWMIService.ExecQuery("SELECT * FROM Win32_BIOS", "WQL", _ 0x10 + 0x20) If Not IsObj($colItems) Then SetError(1, 1, 1) Return -1 Else For $objItem In $colItems Return $objItem.CurrentLanguage Next EndIf EndFunc ; _BIOS_GetCustomLanguage() ; Returns a String containing the Language of the BIOS ; Failure: Sets @error to non-0 and returns -1 Func _BIOS_GetCustomLanguage() $objWMIService = ObjGet("winmgmts:\\localhost\") $colItems = $objWMIService.ExecQuery("SELECT * FROM Win32_BIOS", "WQL", _ 0x10 + 0x20) If Not IsObj($colItems) Then SetError(1, 1, 1) Return -1 Else For $objItem In $colItems Return $objItem.CurrentLanguage Next EndIf EndFunc ; _BIOS_GetCodeSet() ; Returns a String containing the Code Set of the BIOS ; Failure: Sets @error to non-0 and returns -1 Func _BIOS_GetCodeSet() $objWMIService = ObjGet("winmgmts:\\localhost\") $colItems = $objWMIService.ExecQuery("SELECT * FROM Win32_BIOS", "WQL", _ 0x10 + 0x20) If Not IsObj($colItems) Then SetError(1, 1, 1) Return -1 Else For $objItem In $colItems Return $objItem.CodeSet Next EndIf EndFunc ; _BIOS_GetCaption() ; Returns a String containing the Caption of the BIOS ; Failure: Sets @error to non-0 and returns -1 Func _BIOS_GetCaption() $objWMIService = ObjGet("winmgmts:\\localhost\") $colItems = $objWMIService.ExecQuery("SELECT * FROM Win32_BIOS", "WQL", _ 0x10 + 0x20) If Not IsObj($colItems) Then SetError(1, 1, 1) Return -1 Else For $objItem In $colItems Return $objItem.Caption Next EndIf EndFunc ; _BIOS_GetBuild() ; Returns a String containing the Build of the BIOS ; Failure: Sets @error to non-0 and returns -1 Func _BIOS_GetBuild() $objWMIService = ObjGet("winmgmts:\\localhost\") $colItems = $objWMIService.ExecQuery("SELECT * FROM Win32_BIOS", "WQL", _ 0x10 + 0x20) If Not IsObj($colItems) Then SetError(1, 1, 1) Return -1 Else For $objItem In $colItems Return $objItem.BuildNumber Next EndIf EndFunc ; _BIOS_GetVersion() ; Returns a String containing the Version of the BIOS ; Failure: Sets @error to non-0 and returns -1 Func _BIOS_GetVersion() $objWMIService = ObjGet("winmgmts:\\localhost\") $colItems = $objWMIService.ExecQuery("SELECT * FROM Win32_BIOS", "WQL", _ 0x10 + 0x20) If Not IsObj($colItems) Then SetError(1, 1, 1) Return -1 Else For $objItem In $colItems Return $objItem.BIOSVersion(0) Next EndIf EndFunc ; _BIOS_GetCharacteristics() ; Returns a String containing the value of the BIOS Characteristics ; Failure: Sets @error to non-0 and returns -1 Func _BIOS_GetCharacteristics() $objWMIService = ObjGet("winmgmts:\\localhost\") $colItems = $objWMIService.ExecQuery("SELECT * FROM Win32_BIOS", "WQL", _ 0x10 + 0x20) If Not IsObj($colItems) Then SetError(1, 1, 1) Return -1 Else For $objItem In $colItems Return $objItem.BiosCharacteristics(0) Next 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