Retrieve the product key in Windows 10, Windows 8 and Windows 7 with this command

If you lost or forgot where you had stored your Windows product key, here is a solution for you. Today we will see how to retrieve the product key in an installed copy of Windows 10, Windows 8 or Windows 7 with a single command. It is a simple solution to extract your product key from the OS installed on your PC without using any third party software. Here we go.

Retrieve the product key in Windows 10, Windows 8 and Windows  7

You need to open a new command prompt instance and run the command as described below.

  1. Open a new command prompt window.
  2. Type the following command:
    wmic path softwarelicensingservice get OA3xOriginalProductKey

    It will immediately show you the product key.

That's it. If this command fails for you or you need a VBScript to retrieve the product key, then refer to this article: How to view your product key in Windows 10, Windows 8 and Windows 7.

That's it.

Support us

Winaero greatly relies on your support. You can help the site keep bringing you interesting and useful content and software by using these options:

If you like this article, please share it using the buttons below. It won't take a lot from you, but it will help us grow. Thanks for your support!

Author: Sergey Tkachenko

Sergey Tkachenko is a software developer who started Winaero back in 2011. On this blog, Sergey is writing about everything connected to Microsoft, Windows and popular software. Follow him on Telegram, Twitter, and YouTube.

19 thoughts on “Retrieve the product key in Windows 10, Windows 8 and Windows 7 with this command”

      1. It shows only the embeded key in BIOS/UEFI, not Retail key, not VL key, not upgrade key, etc. With that command you will see only the key of the preinstalled Windows version (from factory), so it’ll work only for Windows 8 and above.

  1. I’ve found few other tools as simple and easy to use as ShowkeyPlus (Magic JellyBean is good but it sets off most AV programs).This program comes from Sven Walter, aka Superfly, a long-time active member of the TеnFоrums.соmmunitу. The ultimate source is from his development area at Github: https://github.com/Superfly-Inc/ShowKeyPlus/releases.
    HTH,
    –Ed–

    1. This is a fake “open source” app.
      I prefer to avoid such apps which are hosted on github and pretend to be opened for everyone, but the source code is hosted somewhere else.
      I see no reason to use a third party tool for such a simple task to retrieve the data which can be obtained with a single command.

    2. Thanks Ed for the link, never mind the naysayers. The tool worked great for me, since the command line solution kept giving me “invalid query” errors. What is more, it is hard to navigate around when you’re using Windows in another language like me, so the English tool was a big help.

  2. Command doesn’t work for me on Win10 Home upgraded from Win7 on this Acer laptop. All I get as output is “OA3xOriginalProductKey” on one line and a couple of empty lines after that. ShowKeyPlus meanwhile shows me the (generic) Win10 key as well as the embedded Win7 one. Awesome utility.

  3. In my case, it does not show any key…

    I have a Digital Entitlement…Do you have any idea regarding this???

  4. Either this or the vbs one fails when the product key is cleared from the registry (in my case is because I used slmgr.vbs -cpky).

  5. Does not work for me either. My system is Windows 10 Pro upgraded from Windows 7 Pro.

    All I get is this:
    c:\>wmic path softwarelicensingservice get OA3xOriginalProductKey
    OA3xOriginalProductKey

    c:\>

  6. There is something wrong here. The command above doesn’t show the key used to install, upgrade, or activate Windows. It shows the embeded key in UEFI/BIOS only for a PC or laptop with a factory-preinstalled Windows 8/8.1/10, otherwise it shows an empty line or an error message.

    You can even perform a clean installation of Windows with another version or edition, and use a thousand of activation keys, and the command above will always show the embeded key in BIOS.

  7. Hi,

    This commands only worked for me on Windows 10 pro. It did not work on Windows 7 Home Premiem. Either just work Pro version or just Windows 10

  8. The property “OA3xOriginalProductKey” does not exist in wmic version for Win 7:

    C:\>wmic path softwarelicensingservice get /?

    Property get operations.
    USAGE:

    GET [] []
    NOTE: ::= | ,

    The following properties are available:
    Property Type Operation
    ======== ==== =========
    ClientMachineID string Read
    DiscoveredKeyManagementServiceMachineName string Read
    DiscoveredKeyManagementServiceMachinePort uint32 Read
    IsKeyManagementServiceMachine uint32 Read
    KeyManagementServiceActivationDisabled boolean Read
    KeyManagementServiceCurrentCount uint32 Read
    KeyManagementServiceDnsPublishing boolean Read
    KeyManagementServiceFailedRequests uint32 Read
    KeyManagementServiceHostCaching boolean Read
    KeyManagementServiceLicensedRequests uint32 Read
    KeyManagementServiceListeningPort uint32 Read
    KeyManagementServiceLowPriority boolean Read
    KeyManagementServiceMachine string Read
    KeyManagementServiceNonGenuineGraceRequests uint32 Read
    KeyManagementServiceNotificationRequests uint32 Read
    KeyManagementServiceOOBGraceRequests uint32 Read
    KeyManagementServiceOOTGraceRequests uint32 Read
    KeyManagementServicePort uint32 Read
    KeyManagementServiceProductKeyID string Read
    KeyManagementServiceTotalRequests uint32 Read
    KeyManagementServiceUnlicensedRequests uint32 Read
    PolicyCacheRefreshRequired uint32 Read
    RemainingWindowsReArmCount uint32 Read
    RequiredClientCount uint32 Read
    TokenActivationAdditionalInfo string Read
    TokenActivationCertificateThumbprint string Read
    TokenActivationGrantNumber uint32 Read
    TokenActivationILID string Read
    TokenActivationILVID uint32 Read
    VLActivationInterval uint32 Read
    VLRenewalInterval uint32 Read
    Version string Read

    The following GET switches are available:

    /VALUE – Return value.
    /ALL(default) – Return the data and metadata for the attribute.
    /TRANSLATE: – Translate output via values from .
    /EVERY: [/REPEAT:] – Returns value every (X interval) seconds, If /REPEAT sp
    /FORMAT: – Keyword/XSL filename to process the XML results.

    ….

Leave a Reply

Your email address will not be published.

Exit mobile version
Using Telegram? Subscribe to the blog channel!
Hello. Add your message here.