BIOSの情報を取得

BIOSの情報を取得する。

WMI(Windows Management Instrumentation)を利用してBIOSの情報を取得します。
VBAでWMIから情報を取得するにはSWbemLocatorオブジェクトのConnectServerメソッドを利用してコンピューター上の WMIへ接続することで取得できます。
BIOSの情報は接続したWMIの Win32_BIOSクラス から取得します。

※BIOSとは、コンピュータの最低限の入出力機能のために実行されるプログラムのことで、PCの電源を入れたときにOSが起動する前に実行され、主にキーボード、マウス、メモリ、CPU、ハードディスクなどPCに接続されているハードウェアを制御するためのプログラムです。

'*****************************************************************
' BIOS情報の取得
'*****************************************************************
Sub getBiosInfo()

    'SWbemLocatorオブジェクトを作成してWMIに接続
    Dim oWMI As Object
    Set oWMI = CreateObject("WbemScripting.SWbemLocator").ConnectServer
    
    'オブジェクト取得のクエリを実行
    Dim oQrySet As Object
    Set oQrySet = oWMI.ExecQuery("SELECT * FROM Win32_BIOS")

    'BIOS情報取得
    Dim oBIOS As Object
    For Each oBIOS In oQrySet

        Debug.Print "BIOS Name   : " & oBIOS.Name
        Debug.Print "Description : " & oBIOS.Description
        Debug.Print "Manufacturer : " & oBIOS.Manufacturer
        Debug.Print "SerialNumber : " & oBIOS.SerialNumber
        Debug.Print "ReleaseDate : " & oBIOS.ReleaseDate
        Debug.Print "PrimaryBIOS : " & oBIOS.PrimaryBIOS
            
        Debug.Print "BiosCharacteristics : "
        Dim i As Long
        For i = 0 To UBound(oBIOS.BiosCharacteristics)
            Debug.Print vbTab & getBiosCharacteristics(oBIOS.BiosCharacteristics(i))
        Next
        
        Debug.Print "CurrentLanguage : " & oBIOS.CurrentLanguage
        Debug.Print "BIOSVersion : " & Join(oBIOS.BIOSVersion, ",")
        Debug.Print "SMBIOSBIOSVersion : " & oBIOS.SMBIOSBIOSVersion
        Debug.Print "SystemBiosMajorVersion : " & oBIOS.SystemBiosMajorVersion
        Debug.Print "SystemBiosMinorVersion : " & oBIOS.SystemBiosMinorVersion
        Debug.Print "Status : " & oBIOS.Status
        
    Next

End Sub

'*****************************************************************
' BiosCharacteristics変換
'------------------------------------------------------------------
'  第1引数:BiosCharacteristicsの数値
'------------------------------------------------------------------
'  戻り値 :BiosCharacteristicsの該当する文字列
'*****************************************************************
Function getBiosCharacteristics(sChr) As String

    Dim sRtn As String
    Select Case CInt(sChr)
    Case 0: sRtn = sChr & "-Reserved"
    Case 1: sRtn = sChr & "-Reserved"
    Case 2: sRtn = sChr & "-Unknown"
    Case 3: sRtn = sChr & "-BIOS Characteristics Not Supported"
    Case 4: sRtn = sChr & "-ISA is supported"
    Case 5: sRtn = sChr & "-MCA is supported"
    Case 6: sRtn = sChr & "-EISA is supported"
    Case 7: sRtn = sChr & "-PCI is supported"
    Case 8: sRtn = sChr & "-PC Card (PCMCIA) is supported"
    Case 9: sRtn = sChr & "-Plug and Play is supported"
    Case 10: sRtn = sChr & "-APM is supported"
    Case 11: sRtn = sChr & "-BIOS is Upgradable (Flash)"
    Case 12: sRtn = sChr & "-BIOS shadowing is allowed"
    Case 13: sRtn = sChr & "-VL-VESA is supported"
    Case 14: sRtn = sChr & "-ESCD support is available"
    Case 15: sRtn = sChr & "-Boot from CD is supported"
    Case 16: sRtn = sChr & "-Selectable Boot is supported"
    Case 17: sRtn = sChr & "-BIOS ROM is socketed"
    Case 18: sRtn = sChr & "-Boot From PC Card (PCMCIA) is supported"
    Case 19: sRtn = sChr & "-EDD (Enhanced Disk Drive) Specification is supported"
    Case 20: sRtn = sChr & "-Int 13h - Japanese Floppy for NEC 9800 1.2mb (3.5, 1k Bytes/Sector, 360 RPM) is supported"
    Case 21: sRtn = sChr & "-Int 13h - Japanese Floppy for Toshiba 1.2mb (3.5, 360 RPM) is supported"
    Case 22: sRtn = sChr & "-Int 13h - 5.25 / 360 KB Floppy Services are supported"
    Case 23: sRtn = sChr & "-Int 13h - 5.25 /1.2MB Floppy Services are supported"
    Case 24: sRtn = sChr & "-Int 13h - 3.5 / 720 KB Floppy Services are supported"
    Case 25: sRtn = sChr & "-Int 13h - 3.5 / 2.88 MB Floppy Services are supported"
    Case 26: sRtn = sChr & "-Int 5h, Print Screen Service is supported"
    Case 27: sRtn = sChr & "-Int 9h, 8042 Keyboard services are supported"
    Case 28: sRtn = sChr & "-Int 14h, Serial Services are supported"
    Case 29: sRtn = sChr & "-Int 17h, printer services are supported"
    Case 30: sRtn = sChr & "-Int 10h, CGA/Mono Video Services are supported"
    Case 31: sRtn = sChr & "-NEC PC-98"
    Case 32: sRtn = sChr & "-ACPI supported"
    Case 33: sRtn = sChr & "-USB Legacy is supported"
    Case 34: sRtn = sChr & "-AGP is supported"
    Case 35: sRtn = sChr & "-I2O boot is supported"
    Case 36: sRtn = sChr & "-LS-120 boot is supported"
    Case 37: sRtn = sChr & "-ATAPI ZIP Drive boot is supported"
    Case 38: sRtn = sChr & "-1394 boot is supported"
    Case 39: sRtn = sChr & "-Smart Battery supported"
    Case 40 To 45: sRtn = sChr & "-Reserved for BIOS vendor"
    Case 48 To 63: sRtn = sChr & "-Reserved for system vendor"
    Case Else: sRtn = sChr & "-Unknown Value"
    End Select
    
    getBiosCharacteristics = sRtn

End Function

 ■実行結果

 ※取得した値の一部は伏せた状態での画像になります。