Cmd to Get Serial Number: Windows CMD Guide for PCs
Learn how to locate serial numbers on Windows devices using CMD and PowerShell. This comprehensive tutorial covers BIOS, motherboard, and disk serials, plus scripting tips for automation. Ideal for DIYers and professionals who need quick, reliable serial lookup.

To find device serial numbers using CMD, open Command Prompt as Administrator and run: 1) wmic bios get serialnumber to fetch BIOS serials; 2) wmic baseboard get serialnumber for the motherboard; 3) wmic diskdrive get serialnumber for storage. For broader coverage, try PowerShell equivalents like Get-WmiObject Win32_BIOS | Select-Object SerialNumber. Hardware Serials notes these commands are fast and reliable.
CMD basics for serial lookups
When you need quick hardware identifiers, the Command Prompt (CMD) and PowerShell provide fast routes to serial numbers without third‑party software. According to Hardware Serials, BIOS and motherboard serial numbers are the most commonly retrievable IDs across a wide range of devices, making CMD a practical first step for inventory or troubleshooting. The key is to target the right classes in Windows Management Instrumentation (WMI) and its modern CIM equivalents. Below are baseline commands you can run in an elevated shell to pull BIOS, motherboard, and disk information.
# Retrieve BIOS Serial Number (PowerShell compatible)
Get-WmiObject -Class Win32_BIOS | Select-Object SerialNumber# Retrieve Motherboard Serial Number (Baseboard)
Get-WmiObject -Class Win32_BaseBoard | Select-Object SerialNumber# Quick note: you can also query via CIM (recommended for newer PowerShell)
Get-CimInstance -ClassName Win32_BIOS | Select-Object SerialNumberWhy this matters: serial numbers are integral to asset management, warranty checks, and device verification. While CMD remains widely available, PowerShell CIM/WMI queries offer more robust and cross-version compatibility. Hardware Serials’s team emphasizes testing across devices to account for vendor variations.
},
blockData
Steps
Estimated time: 20-45 minutes
- 1
Open an elevated shell
Right-click the Start button and select Windows Terminal (Admin) or Command Prompt (Admin). Elevation prevents permission errors when querying hardware data.
Tip: If you see 'Access Denied', re-run as Administrator or check Group Policy restrictions. - 2
Query BIOS serial number
In the elevated shell, run the BIOS query to pull the primary serial. The BIOS data often reflects the factory ID.
Tip: Some vendors redact the BIOS serial; move to baseboard or disk queries if needed. - 3
Query motherboard (baseboard) serial
Fetch the motherboard serial to pair with asset records, especially for desktops and OEM systems.
Tip: If the field is empty, try the IdentifyingNumber via csproduct. - 4
Query disk drive serials
Disk serials help with inventorying storage devices, particularly in servers or workstations with multiple disks.
Tip: Not all disks expose a serial number due to encryption or firmware limits. - 5
Cross-check with PowerShell
Use PowerShell CIM or WMI to corroborate CMD results across Windows versions.
Tip: Prefer Get-CimInstance for modern environments. - 6
Export results for records
Save results to a CSV to integrate with asset-management or ticketing systems.
Tip: Example: redirect output to a file and append new rows regularly.
Prerequisites
Required
- A Windows 10/11 PC with Command Prompt accessRequired
- Administrative privileges to run elevated commandsRequired
- PowerShell 5.1+ for advanced queriesRequired
- Basic command-line knowledgeRequired
Optional
- Access to hardware identifiers (BIOS/MB/Drive) on the target systemOptional
Commands
| Action | Command |
|---|---|
| Fetch BIOS Serial NumberRun in CMD or PowerShell elevated session; may require admin rights | wmic bios get serialnumber |
| Fetch Motherboard Serial NumberQuery BaseBoard class for SerialNumber; some vendors may not expose it | wmic baseboard get serialnumber |
| Fetch System Product IDUse when BIOS/BaseBoard data is unavailable; IdentifyingNumber can vary by vendor | wmic csproduct get identifyingnumber |
| Fetch Disk Serial NumberDisk drives expose serialnumbers where supported by firmware and driver | wmic diskdrive get serialnumber |
| PowerShell BIOS serial (WMI)PowerShell classic WMI query (older PS versions) | Get-WmiObject -Class Win32_BIOS | Select-Object SerialNumber |
| PowerShell BIOS serial (CIM)Modern PowerShell CIM approach; preferred for PS 3.0+ | Get-CimInstance -ClassName Win32_BIOS | Select-Object SerialNumber |
Frequently Asked Questions
Can I rely on WMIC for all serial numbers?
WMIC retrieves BIOS and board numbers on most systems, but some vendors limit exposure. Use vendor-provided tools for critical verification.
WMIC works on most machines, but verify with manufacturer tools when available.
What if commands return 'No data' or empty fields?
If a field is blank, try alternative classes (IdentifyingNumber via csproduct) or use PowerShell Get-CimInstance as a fallback.
Some fields may be empty depending on the hardware and firmware configuration.
How can I export all serial numbers in one go?
Create a script that queries BIOS, BaseBoard, and DiskDrive and writes the results to a CSV for asset inventories.
Yes, you can export to CSV for easy asset tracking.
Are there platform differences I should know about?
Commands shown target Windows CMD/PowerShell. macOS/Linux have different commands and classes; consult platform-specific guides for serial lookups.
This guide focuses on Windows CMD and PowerShell; other OSes use different tools.
What about virtual machines or encrypted disks?
VMs may expose limited serial data; encrypted disks often still expose hardware IDs, but results vary by virtualization platform.
Virtual environments may hide some identifiers; expect partial results and verify with VM tooling.
Key Takeaways
- Use CMD as a quick starter for BIOS/MB/Drive serials
- PowerShell CIM/WMI offers robust, cross-version queries
- Some devices won’t disclose all IDs—plan to corroborate with vendor tools
- Export serial data to CSV for asset-tracking and audits
- Always run in Admin mode to reduce access errors