Packetwatch.net

Get system serial number in Windows



Last modified: Nov. 20, 2009

Contents
1 - Summary
2 - Example WMI script


1 - Summary

This guide shows you how to get the system serial number and BIOS information
in Windows. It includes a WMI script written in WSH (VBScript). This script
has been tested in Windows 2000, XP, 2003 and 2008.


2 - Example WMI script

The following script will display the system manufacturer, product name,
serial number and BIOS version. Save this file with the extension of .vbs.

----------
set objWMIService = GetObject( "winmgmts://./root/cimv2" )
set colComputerSystem = objWMIService.ExecQuery( "select * from Win32_ComputerSystem", , 48 )
set colBIOS = objWMIService.ExecQuery( "select * from Win32_BIOS", , 48 )

for each objItem in colComputerSystem
	strMsg = strMsg _
	       & "System Manufacturer: " & objItem.Manufacturer & vbCrLf _
	       & "Product Name: " & objItem.Model & vbCrLf
next
for each objItem in colBIOS
	strMsg = strMsg _
	       & "Serial Number: " & objItem.SerialNumber & vbCrLf _
	       & "BIOS Version: " & objItem.SMBIOSBIOSVersion & vbCrLf
next

WScript.Echo strMsg
WScript.Quit(0)
----------

A dialogue box will open with the following information as an example.

System Manufacturer: Dell Computer Corporation
Product Name: PowerEdge 1800
Serial Number: XXXXXXX
BIOS Version: XXX


Last modified: Thu Jan 1 00:00:00 1970 UTC
Packetwatch Research 2002-2017.