Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

3 Answers 3

up vote 3 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
1  
wmic os get "SerialNumber" works great. –  amiregelz Oct 30 '12 at 18:46
1  
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
    
Yes, type it and you will see that the text "SerialNumber" comes before the ID itself. Test it by using a pipe, for example wmic os get "SerialNumber" > txt.txt, then open txt.txt on notepad. –  Diogo Oct 30 '12 at 19:07

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.

Reference.

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

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

Your Answer

 
discard

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.