Extract Windows 8 (8.1) Product Key without Software


This tutorial covers everything on how to get or recover the product key of Windows 8 (8.1) version. Users can also approach another way of getting Windows 8 (8.1) Product Key by using few third party software like Belarc Advisor. We have done a video showing step by step procedure on how to find Windows 8 Product Key on a Preinstalled OS using a Software. Learning new things will always upgrades current knowledge. So, try out this method of extracting Windows 8 (8.1) Product Key without using any software.


How to Find Windows 8.1 Product Key

To explain better, we are splitting this tutorial in to 3 steps. Let’s begin the work. 😉

Step 1: Get the right PowerShell Script

In this step, user need to collect some script or code from the Microsoft Technet website. We also provided the script here, but keep an eye on Microsoft Technet website if it doesn’t work for you (they updates the code). Here is the script,

function Get-WindowsKey {
    ## function to retrieve the Windows 8 or 8.1 Product Key from any PC
    param ($targets = ".")
    $hklm = 2147483650
    $regPath = "Software\Microsoft\Windows NT\CurrentVersion"
    $regValue = "DigitalProductId"
    Foreach ($target in $targets) {
        $productKey = $null
        $win32os = $null
        $wmi = [WMIClass]"\\$target\root\default:stdRegProv"
        $data = $wmi.GetBinaryValue($hklm,$regPath,$regValue)
        $binArray = ($data.uValue)[52..66]
        $charsArray = "B","C","D","F","G","H","J","K","M","P","Q","R","T","V","W","X","Y","2","3","4","6","7","8","9"
        ## decrypt base24 encoded binary data
        For ($i = 24; $i -ge 0; $i--) {
            $k = 0
            For ($j = 14; $j -ge 0; $j--) {
                $k = $k * 256 -bxor $binArray[$j]
                $binArray[$j] = [math]::truncate($k / 24)
                $k = $k % 24
            $productKey = $charsArray[$k] + $productKey
            If (($i % 5 -eq 0) -and ($i -ne 0)) {
                $productKey = "-" + $productKey
        $win32os = Get-WmiObject Win32_OperatingSystem -computer $target
        $obj = New-Object Object
        $obj | Add-Member Noteproperty Computer -value $target
        $obj | Add-Member Noteproperty Caption -value $win32os.Caption
        $obj | Add-Member Noteproperty CSDVersion -value $win32os.CSDVersion
        $obj | Add-Member Noteproperty OSArch -value $win32os.OSArchitecture
        $obj | Add-Member Noteproperty BuildNumber -value $win32os.BuildNumber
        $obj | Add-Member Noteproperty RegisteredTo -value $win32os.RegisteredUser
        $obj | Add-Member Noteproperty ProductID -value $win32os.SerialNumber
        $obj | Add-Member Noteproperty ProductKey -value $productkey
Get-WindowsKey localhost

Copy the above code and open Notepad then paste the script exactly. Now save the file with name “RecoverKey.ps1“.

Step 2: Run the Saved PowerShell Script

Here comes the second step.

Now open Windows PowerShell by going to Windows Metro Style dashboard (Press Windows button) and search for “PowerShell“. Right click on the application then select “Run as Administrator“. Hit “Yes” when you prompted with UAC dialog box.

Step 3: Finally, find the Windows 8.1 Product Key

Final step. User need to type couple of commands here. Here you go.

Firstly type the following command on PowerShell

Set-ExecutionPolicy RemoteSigned

Type “Y” when it displays “Do you want to change the execution policy” message.

Next type the second command and hit Enter to extract Pre Installed Product key of Windows 8 Operating System

Import-Module PATH; Get-WindowsKey

How to Get Path of PowerShell Script file?

Right click on RecoverKey.ps1 file. Move to Properties then switch to “Security” tab. Copy the Object Name path and paste it in PowerShell.

[Updated] If it returns any error like showing product key as “BBBBB-BBBBB-BBBBB-BBBBB” then follow these updated methods to find Windows 8 Product Key on Preloaded Laptop.

Video Tutorial


  1. hi

    thanks very much, i had really struggled to activate windows 8.1 pro, but after following your steps, i managed to activate it without any hassles. thanks you very much this was really helpful

  2. i changed my windows 7 64bit to windows 8.1 pro build 9600 i have tried to activate it but the last stage of the command is not bring out any result please sir i need help.

  3. hi Sai Praveen , I am using windows8 pro build 9200 and third step is not working, it says,

    Import-Module : A positional parameter cannot be found that accepts argument ‘saini\Desktop\RecoverKey.ps1’.

    etc…. Plz reply soon

  4. hi there. Can i do this tutorial even in my laptop running windows 8.1 that is not came preinstalled in windows 8.1 pro? i’ve lost my case and i wonder if i can also do this same thing. thank you.

    • You can do. But if you believe that the OS installed is genuine, then you will get the product key. Otherwise, it will return you all BBBBB’s

  5. The problem is there are missing “\” in some of the commands in the script such as the line:
    $regPath = “SoftwareMicrosoftWindows NTCurrentVersion”
    where it should be
    $regPath = “Software\Microsoft\Windows NT\CurrentVersion”

  6. Sir i tried it and i got the key by ur method . But even that product key is not working.What could be the problem?.mine is windows8,1 pr0

  7. I’ve tried this entire process and I got a product key. However, upon trying to enter the Key in PC Settings, it gives an error:
    This key didn’t work, please check it and try again, or try a different key


Please enter your comment!
Please enter your name here