Reputation: 65
I am trying to get the serial number of the bios.
I've used (Win32_BIOS) with Delphi code and it's working fine on multiple devices, but some devices return (00000000) as a result. When I try (wmic bios get serialnumber) at the terminal I get the same result (00000000). I've checked if the WMI Services is running/updated, but still get the same result.
When I try to use WMI Diagnosis Utility it's showing message (not compatible with your windows).
Note: The result is returned on some devices that working on (windows7 32bit)
Thanks a lot.
Upvotes: 1
Views: 5074
Reputation: 263
WMI obtains most of the system information through SMBIOS. This standard allows manufacturers/OEMs to give information via firmware.
In your case, Win32_BIOS corresponds with Serial Number in the System Information structure. This was added in 2.0+ standard, so first you have to check if the board is older than that. In any case, unless the computer is from a OEM it's usually not set.
However, there's usually more information. If the board supports SMBIOS 2.1+, there's the UUID on the same struct. Some manufacturers do not fill them but I have found more success with that number than others. Note that this UUID it's not in the Win32_board, Win32_ComputerSystemProduct:
wmic path win32_computersystemproduct get uuid
There's more information in the SMBIOS which you can use for identification, ideally you should combine all of it so even if it most of it it's zeroed you can get a reasonable result. Note that you can't just get the values from the table via GetSystemFirmwareTable, as Windows zeroes parts of it (see this .doc from Microsoft).
You can also try using CPUID, but with the controversy in PIII, most computers don't have the serial number enabled (or it's not supported at all). Note that ProcessorID from the Win32_CPU WMI class doesn't give this value, it also comes from SMBIOS.
In summary, try to get as many values from SMBIOS as you can (SerialNumber, UUID, processor identification, hard disk..etc) and other sources (MAC addr, CPUID, Windows product information... etc), and be aware that there's still no guarantee that this will be unique.
Upvotes: 2