Retrieving Information About the BIOS
Microsoft® Windows® 2000 Scripting Guide
Each computer has a BIOS that is used to configure basic computer settings, including fundamental properties such as whether a password is required to start the computer and how memory can be configured. The BIOS also helps determine which hardware can be installed on a computer. For example, before you can add a new CPU or a new motherboard to a computer, you must make sure the computer has the correct version of the BIOS.
BIOS manufacturers routinely issue BIOS upgrades that enable a computer to support new classes of hardware or that add features to the computer. Before installing such an upgrade, you must know which version of a BIOS has been installed on a computer. Attempting to add hardware to a computer that does not support this hardware can cause serious problems. Problems can also occur if you attempt to install a BIOS upgrade on a computer that does not use that particular BIOS to begin with.
Note
- The make and model of a computer are not always indicative of which BIOS has been installed on that computer. Two seemingly identical computers from the same manufacturer might use different BIOS.
You can use the Win32_BIOS class to enumerate the properties of the BIOS installed in your computer. Table 8.2 lists some of the more commonly used properties of the Win32_BIOS class, including properties related to the installed version of SMBIOS.
Table 8.2 Win32_BIOS Properties
Property |
Description |
---|---|
BIOSCharacteristics |
Array of BIOS characteristics supported by the computer as defined by the SMBIOS Reference Specification. The possible values for this property are: 3 - BIOS characteristics not supported 4 - ISA is supported 6 - EISA is supported 7 - PCI is supported 8 - PC Card (PCMCIA) is supported 9 - Plug and Play is supported 10 - APM is supported 11 - BIOS is upgradable (flash) 15 - Boot from CD is supported 16 - Selectable boot is supported 17 - BIOS ROM is socketed 18 - Boot from PC card (PCMCIA) is supported 32 ACPI supported 34 AGP is supported |
BuildNumber |
Internal identifier for the BIOS. |
CurrentLanguage |
Name of the current BIOS language. |
InstallableLanguages |
Number of languages available for installation on this computer. |
Manufacturer |
Manufacturer of the BIOS. |
Name |
Name used to identify the BIOS. |
PrimaryBIOS |
Indicates whether this is the primary BIOS of the computer. |
ReleaseDate |
Release date of the BIOS. Dates are in the Universal Time Coordinate (UTC) format yyyymmddHHMMSS.xxxxxx-UUU, where:
For example, a BIOS released on October 31, 2002, at 10:45:39 A.M. Pacific time looks like this: |
SerialNumber |
Serial number assigned to the BIOS by the manufacturer. |
SMBIOSVersion |
BIOS version as reported by SMBIOS. |
SMBIOSMajorVersion |
Major SMBIOS version number. |
SMBIOSMinorVersion |
Minor SMBIOS version number. |
SMBIOSPresent |
Indicates whether the SMBIOS is available on this computer. |
Version |
Version of the BIOS. |
Some, but not all, of this information is also available through the System Information snap-in, as shown in Figure 8.2.
Figure 8.2 Win32_BIOS Properties and System Information
Scripting Steps
Listing 8.2 contains a script that retrieves BIOS information for a computer. To carry out this task, the script must perform the following steps:
Create a variable to specify the computer name.
Use a GetObject call to connect to the WMI namespace root\cimv2, and set the impersonation level to "impersonate."
Use the ExecQuery method to query the Win32_BIOS class.
This query returns a collection consisting of a single object representing the BIOS installed on the computer.
For each BIOS in the collection, echo the retrieved values.
Because the BIOS characteristics are contained within an array, a For Each loop must be used to loop through each element in the array.
Listing 8.2 Retrieving BIOS Information
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
|