I need to retrieve the hardware serial numbers from a set of new HP mini desktops that need provisioning.

This worked in the past using a WSH script to query it via WMI. Unfortunately, the newer models no longer contain a BIOS but rather come with EFI instead. All known ways of querying the information no longer work.

I've googled the subject quite a bit but all the answers I found recommend the ineffective method above. Can anyone help? I need a solution that will work with XP (embedded) if it makes a difference.


dmidecode in linux is capable of pulling this information via EFI, there is a port available here http://gnuwin32.sourceforge.net/packages/dmidecode.htm which appears to be compiled after EFI support. The command would dmidecode -s system-serial-number as tested on my BIOS based system, however I'm unable to test fully as I havn't got an EFI system to hand.

  • Interesting, thanks. Unfortunately the need was for Windows. – Gringo Suave Sep 12 '11 at 18:45
  • There are other programs available for Windows that read the information out of the DMI table - this is a valid answer. – MikeyB Sep 12 '11 at 19:08
  • 1
    This is a port to windows, tested on windows 7. The link is for a windows executable. – Alex Berry Sep 13 '11 at 8:11

We found out the model we had was a pre-release box, and a serial number hadn't been assigned yet. Once trying it on a newer box, it worked just fine. The value was available via WMI after all.

Nothing to see here, move along. ;)

Scripting examples in the language of your choice to print serial numbers can be found at Microsoft TechNet.

  • 1
    Can you post the actual command used to retrieve the serial number to assist future visitors? – MikeyB Sep 12 '11 at 19:09

Scriptomatic 2 (available free from Microsoft) allows you to easily browse all of WMI and provides you with the scripts needed to do so.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.