One-Liner: Getting This Computer’s Serial Number

The computer’s serial number can be very useful.  Among other things, many manufactuers’ support sites keep record of their machine’s serial numbers to serve the right drivers for downloads.

CMD> wmic bios get serialnumber

Wmic is the command line executable for performing simple WMI queries.  BIOS is wmic’s shorthand for Win32_bios.  The PowerShell equivalent would be

PSH> (Get-WmiObject win32_bios).SerialNumber

On the production machines I work with, some do not have PowerShell installed. This being a production environment, installing PowerShell is not an option, so the wmic alternative is welcome.

Comments (0)