How to retrieve serial number in Windows

Published: May 15, 2025

Last updated: May 15, 2025

Microsoft logo

Introduction

This is a quick tutorial on how to retrieve your computer's serial number in Windows using Command Prompt (CMD) or PowerShell (PS).

CMD

To retrieve a serial number in CMD we'll be using the Windows Management Instrumentation Command (WMIC).
The command is:

wmic bios get serialnumber

Example:
Command Prompt window displaying the output of the command 'wmic bios get serialnumber'

Please note, WMIC has been deprecated. You can learn more about that by reading this Microsoft blog post.
A timeline spanning from 2016 until 2024/TBD, illustrating the WMIC deprecatrion timeline.

You can also re-install WMIC by following this Mircosoft tutorial.

PS

To retrieve a serial number in PS we'll be using the Windows Management Instrumentation (WMI) command. Windows PowerShell for WMI supersedes WMIC.
The command is:

Get-WmiObject -Class Win32_Bios | Select SerialNumber

Example:
PowerShell window displaying the output of the command 'Get-WmiObject -Class Win32_Bios | Select SerialNumber'

References: