Retrieve your Windows Product Key without extra software

Discussion in 'Windows 10 Tutorials' started by Neemobeer, Feb 22, 2016.

  1. Neemobeer

    Neemobeer Windows Forum Team
    Staff Member

    Joined:
    Jul 4, 2015
    Messages:
    2,417
    Likes Received:
    366
    This quick tutorial shows you how to retrieve your Windows product key from a working system. This is helpful in cases where your device doesn't have a sticker.

    • Open powershell (Press the Windows Key, then type powershell)
    • Type the following command
    pskey.

    The output will be your 25 character Windows product key in the form XXXXX-XXXXX-XXXXX-XXXXX-XXXXX

    This should work on Windows 7, 8, 8.1 and 10
     
    LoboVerde likes this.
  2. strollin

    strollin Senior Member

    Joined:
    Jul 21, 2013
    Messages:
    286
    Likes Received:
    36
    Copy & paste below so you don't need to type the command:

    Code:
    $(Get-WmiObject -query 'select * from SoftwareLicensingService').OA3xOriginalProductKey
     
  3. Neemobeer

    Neemobeer Windows Forum Team
    Staff Member

    Joined:
    Jul 4, 2015
    Messages:
    2,417
    Likes Received:
    366
    I suppose that would have been helpful, thanks @strollin
     
  4. bochane

    bochane Honorable Member

    Joined:
    Oct 18, 2012
    Messages:
    643
    Likes Received:
    47
    Hm, I just see nothing...:(
    I must be doing something wrong :confused:
     
  5. strollin

    strollin Senior Member

    Joined:
    Jul 21, 2013
    Messages:
    286
    Likes Received:
    36
    Are you pasting the command above into the PowerShell prompt? (Won't work from a normal command prompt)
     
  6. Neemobeer

    Neemobeer Windows Forum Team
    Staff Member

    Joined:
    Jul 4, 2015
    Messages:
    2,417
    Likes Received:
    366
    bochane try just tying Get-WmiObject -query 'select * from SoftwareLicensingService' and look for the OAx3OriginalProductKey property.
     
  7. bochane

    bochane Honorable Member

    Joined:
    Oct 18, 2012
    Messages:
    643
    Likes Received:
    47
    Did that, but OAx3OriginalProductKey is empty

    I started this PC with Windows 7, bought an SSD and an update to W8 and installed it multibootable. The last step was switching from W8.1 to W10.
    Nevertheless I expected a licence.

    Added:
    Same result on my laptop, an empty OAx3OriginalProductKey property. And again it started with XP, got a free upgrate from Acer to W7 and is now running W10

    Thanks for looking into it.
     
    #7 bochane, Feb 23, 2016
    Last edited: Feb 23, 2016
  8. cursedboy

    cursedboy Senior Member

    Joined:
    Apr 15, 2012
    Messages:
    40
    Likes Received:
    1
    This trick work better for me
    1. Open Notepad.
    2. Copy and paste the following text into the Notepad window

    Code:
    Option Explicit
    
    Dim objshell,path,DigitalID, Result
    Set objshell = CreateObject("WScript.Shell")
    'Set registry key path
    Path = "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\"
    'Registry key value
    DigitalID = objshell.RegRead(Path & "DigitalProductId")
    Dim ProductName,ProductID,ProductKey,ProductData
    'Get ProductName, ProductID, ProductKey
    ProductName = "Product Name: " & objshell.RegRead(Path & "ProductName")
    ProductID = "Product ID: " & objshell.RegRead(Path & "ProductID")
    ProductKey = "Installed Key: " & ConvertToKey(DigitalID)
    ProductData = ProductName  & vbNewLine & ProductID  & vbNewLine & ProductKey
    'Show messbox if save to a file
    If vbYes = MsgBox(ProductData  & vblf & vblf & "Save to a file?", vbYesNo + vbQuestion, "BackUp Windows Key Information") then
       Save ProductData
    End If
    
    
    
    'Convert binary to chars
    Function ConvertToKey(Key)
        Const KeyOffset = 52
        Dim isWin8, Maps, i, j, Current, KeyOutput, Last, keypart1, insert
        'Check if OS is Windows 8
        isWin8 = (Key(66) \ 6) And 1
        Key(66) = (Key(66) And &HF7) Or ((isWin8 And 2) * 4)
        i = 24
        Maps = "BCDFGHJKMPQRTVWXY2346789"
        Do
               Current= 0
            j = 14
            Do
               Current = Current* 256
               Current = Key(j + KeyOffset) + Current
               Key(j + KeyOffset) = (Current \ 24)
               Current=Current Mod 24
                j = j -1
            Loop While j >= 0
            i = i -1
            KeyOutput = Mid(Maps,Current+ 1, 1) & KeyOutput
            Last = Current
        Loop While i >= 0
        keypart1 = Mid(KeyOutput, 2, Last)
        insert = "N"
        KeyOutput = Replace(KeyOutput, keypart1, keypart1 & insert, 2, 1, 0)
        If Last = 0 Then KeyOutput = insert & KeyOutput
        ConvertToKey = Mid(KeyOutput, 1, 5) & "-" & Mid(KeyOutput, 6, 5) & "-" & Mid(KeyOutput, 11, 5) & "-" & Mid(KeyOutput, 16, 5) & "-" & Mid(KeyOutput, 21, 5)
       
       
    End Function
    'Save data to a file
    Function Save(Data)
        Dim fso, fName, txt,objshell,UserName
        Set objshell = CreateObject("wscript.shell")
        'Get current user name
        UserName = objshell.ExpandEnvironmentStrings("%UserName%")
        'Create a text file on desktop
        fName = "C:\Users\" & UserName & "\Desktop\WindowsKeyInfo.txt"
        Set fso = CreateObject("Scripting.FileSystemObject")
        Set txt = fso.CreateTextFile(fName)
        txt.Writeline Data
        txt.Close
    End Function
    
    3. Save the text above to a file with the ".vbs" extension on the Desktop.

    Bonus tip: To make sure that you saving the file correctly with the ".vbs" extension, you can type its name enclosed in double quotes, for example, "BackupWindowsKey.vbs".

    4. Now open your BackupWindowsKey.vbs file

    I hope this work for you.

     
  9. RichM

    RichM Active Member

    Joined:
    May 9, 2016
    Messages:
    321
    Likes Received:
    49
    Seems like a lot of work to me when Belarc will show the key as will "Show Key" though I realize the other 3rd party ones no longer work after Windows 8.
    Showkey - Windows 10 Forums
     
  10. Sonny

    Sonny Fantastic Member

    Joined:
    Nov 17, 2009
    Messages:
    1,258
    Likes Received:
    93
    Speccy will also show the key in Windows 10.
     
  11. joosera

    joosera New Member

    Joined:
    Jun 2, 2016
    Messages:
    3
    Likes Received:
    0
    It works great on Windows 8.1.
     

Share This Page

Loading...