Win32_BIOS version

StewartBW 1,215 Reputation points
2025-03-12T13:13:50.4633333+00:00

Hello

I'm using this code to get the BIOS version:

Dim Search2 As New ManagementObjectSearcher(New SelectQuery("Win32_BIOS"))
    For Each Info2 As ManagementObject In Search2.Get
        If Info2("SMBIOSBIOSVersion") IsNot Nothing Then MsgBox Info2("SMBIOSBIOSVersion").ToString
    Next

On systems without SMBIOS that have SMBIOSPresent set to False, will above code raise any exception?

I mean just checking If Info2("SMBIOSBIOSVersion") IsNot Nothing is enough?

Or should also check If Info2("SMBIOSPresent") IsNot Nothing AndAlso Convert.ToBoolean(Info2("SMBIOSPresent")) = True before going to get the SMBIOS version?

Thanks for advise :)

VB
VB
An object-oriented programming language developed by Microsoft that is implemented on the .NET Framework. Previously known as Visual Basic .NET.
2,798 questions
0 comments No comments
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.