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.

Windows 10 retrieve product keyThat'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.

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

  1. jack

    all keys or just retail

    Reply
    1. Sergey Tkachenko Post author

      I have not tried it in editions other than retail.

      Reply
      1. BroWinTech

        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.

        Reply
  2. Ed Tittel

    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–

    Reply
    1. Sergey Tkachenko Post author

      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.

      Reply
      1. Phil

        You are correct

        Reply
    2. JP

      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.

      Reply
  3. Bob

    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.

    Reply
  4. Tanmoy Das

    It not showing the key…

    Reply
  5. Aritra Nath

    In my case, it does not show any key…

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

    Reply
  6. dism

    Unfortunatelly Command Doesn’t work error: Invalid Query

    Reply
    1. Harry

      Same here, it just replies with Invalid Query

      Reply
  7. Tsuchida

    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).

    Reply
  8. Delta

    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:\>

    Reply
    1. David H Johnson

      I received the same thing but the vbs worked great!

      Reply
  9. BroWinTech

    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.

    Reply
  10. JDTX

    Does not work for Win 10×64 Retail…

    Reply
  11. Jose Pimenta

    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

    Reply
  12. Mike

    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.

    ….

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *