Find out the Windows product key via DOS command or PowerShell

Reading the correct Windows key from an existing Windows system is not that easy. In the past, if you maybe bought a finished OEM PC from Dell, HP or another computer manufacturer a few years ago , the Windows license certificate including the Windows product key was stuck on the housing.

That was changed with Windows 8 and Windows 10 at the latest. In the PCs that can be bought today, the Windows Keys are stored directly in the BIOS / UEFI. But today we want to show you 2 ways of reading out the complete key.

Read out the Windows key using the DOS command WMIC

With WMIC you can read out the key with the following command and parameters.

wmic path software licensing service get OA3xOriginalProductKey

After entering this WMIC command , the complete product key will then be displayed, as you can see below.

Read out Windows key with WMIC

Read Windows product key with PowerShell

With Windows PowerShell it is also relatively easy, if not as fast as with the WMIC command. The PowerShell command is:

powershell “(Get-WmiObject -query ‘select * from SoftwareLicensingService’). OA3xOriginalProductKey”

Below you can see the result.

Query Windows product key with Powershell

We think both options are fairly easy to use and often replace the use of special tools to read the Windows product key. Do you know any other options, we would be happy to receive a comment.

We have already presented some very useful WMIC commands in the past , which we would like to briefly introduce to you here:

– Configure the firewall for WMIC remote queries in Windows 7
– WMIC – Software inventory without additional software
– Software inventory via VBS script
– Read PC serial number from BIOS
– “Sticky Notes” for Windows 7, 8 and Windows 10

administrator