Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I know it is possible to find the Windows 8 Product ID in the "System" page located in the Control Panel.

But is it possible to get the Windows 8 Product ID using the command prompt?

share|improve this question
You are aware the Product Id is NOT the key you use to install with, right? :) – Ƭᴇcʜιᴇ007 Oct 30 '12 at 18:35
@techie007 Yes, of course. – amiregelz Oct 30 '12 at 18:37
up vote 7 down vote accepted

Here are a few ways suitable for use in batch files:

wmic os get "SerialNumber" | find /v "SerialNumber"

for /f "tokens=3" %p in ('SystemInfo ^| find "Product ID"') do @echo %p

for /f "tokens=3" %p in ('reg query "HKLM\Software\Microsoft\Windows NT\CurrentVersion" /v ProductID') do @echo %p
share|improve this answer
wmic os get "SerialNumber" works great. – amiregelz Oct 30 '12 at 18:46
Yup, the extra find bit is just so it returns the PID only and no other text, so you can easily assign it to a variable for example. – Karan Oct 30 '12 at 18:47
Actually it still return "SerialNumber" text. – Diogo Oct 30 '12 at 18:48
Are you sure? It doesn't for me, if I use the entire command specified with the find bit included. I tested all 3 before posting. – Karan Oct 30 '12 at 18:49
Precisely. The find /v bit removes all other lines except the one displaying the SerialNumber. – Karan Oct 30 '12 at 19:10

It is possible by using WMI (Windows Management Interface)or with quering a value from Windows Registry.

With WMI:

  1. From command line type the "wmic" and Enter

  2. Inside WMI, Type "OS"

  3. Look over "SerialNumber" value. It contains your Windows 8 ProductID.

PS: Alternatively you could also type "wmic OS" from cmd and search for SerialNumber.


With Windows Registry:

  1. Just type the folowing command from cmd:

    reg query HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\\ProductID

or even:

reg query HKLM\SOFTWARE\Microsoft\Internet Explorer\Registration\ProductID

(Internet Explorer have the same ID as Windows 8)

share|improve this answer
This returns a very long line of text (or a very messy text if I type wmic OS). Is it possible to get only the Product ID? – amiregelz Oct 30 '12 at 18:44
Edited, by using the second method yes...(It looks weird but Internet Explorer have the same ID as Windows) – Diogo Oct 30 '12 at 18:45

use following command:

wmic path softwarelicensingservice get OA3xOriginalProductKey

Tested on my genuine @in 8.1 64 bit. Reference -

share|improve this answer

You can use Windows' SystemInfo command.

It will return a list of info about the system, including that Product ID (about the 9th line down give or take.)

From MS:

Displays detailed configuration information about a computer and its operating system, including operating system configuration, security information, product ID, and hardware properties, such as RAM, disk space, and network cards.

If you want to extract just that line you can use systeminfo | find /i "product id".

share|improve this answer
Is it possible to get the Product ID exclusively? – amiregelz Oct 30 '12 at 18:42
@amiregelz Yeah there is, at least just that line; see my updated answer. :) – Ƭᴇcʜιᴇ007 Oct 30 '12 at 18:49

in command prompt type: wmic path SoftwareLicensingService get OA3xOriginalProductKey

this works in windows 8

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.