How to Backup Product Key of Windows 10, 8.1 – 3 Steps

Procedures to Backup Product Key of Windows 10 through steps.

When your Windows OS gets corrupt or crashed and the ultimate method remains is reinstallation then a million dollar concern is Product key. So you must note and keep a backup copy of the product or activation key for avoiding an issue. You know the computer will be activated only when you reinsert the Product key of the crashed software.

If you are cautious a bit you can easily Backup Product Key of Windows 10, 8.1, and 8. This is a 3 Step method that could be proved as Windows PC Life savior. A script is pretty good working for all the Windows versions as 10, 8, and 8.1. The filename you will download is windowsbackupproductkey.ps1.

Backup Product Key of Windows 10, 8.1 and 8

Step 1 – Press the shortcuts combination Win+R, write notepad in the given space, and then click Enter.

Backup Product Key of Windows 10, 8.1 and 8 pic 1

Step 2– Once the notepad appears on the computer’s screen, copy the below bundle of scripts and paste into it –

#Main function
Function GetWin8Key
{
$Hklm = 2147483650
$Target = $env:COMPUTERNAME
$regPath = "Software\Microsoft\Windows NT\CurrentVersion"
$DigitalID = "DigitalProductId"
$wmi = [WMIClass]"\\$Target\root\default:stdRegProv"
#Get registry value
$Object = $wmi.GetBinaryValue($hklm,$regPath,$DigitalID)
[Array]$DigitalIDvalue = $Object.uValue
#If get successed
If($DigitalIDvalue)
{
#Get producnt name and product ID
$ProductName = (Get-itemproperty -Path "HKLM:Software\Microsoft\Windows NT\CurrentVersion" -Name "ProductName").ProductName
$ProductID = (Get-itemproperty -Path "HKLM:Software\Microsoft\Windows NT\CurrentVersion" -Name "ProductId").ProductId
#Convert binary value to serial number
$Result = ConvertTokey $DigitalIDvalue
$OSInfo = (Get-WmiObject "Win32_OperatingSystem" | select Caption).Caption
If($OSInfo -match "Microsoft Windows 8" -or $OSInfo -match "Microsoft Windows 10")
{
if($Result)
{ [string]$value ="ProductName : $ProductName `r`n" `
+ "ProductID : $ProductID `r`n" `
+ "Installed Key: $Result"
$value
#Save Windows info to a file
$Choice = GetChoice
If( $Choice -eq 0 )
{
$txtpath = "C:\Users\"+$env:USERNAME+"\Desktop"
New-Item -Path $txtpath -Name "WindowsKeybackup.txt" -Value $value -ItemType File -Force | Out-Null
}
Elseif($Choice -eq 1)
{
Exit
}
}
Else
{
Write-Warning "Please run this script on Windows 8.x or Windows 10"
}
}
Else
{
Write-Warning "Please run this script on Windows 8."
} }
Else
{
Write-Warning "Failed to get Windows 8 product key,Some error occured."
}}
#Get user choice
Function GetChoice
{
$yes = New-Object System.Management.Automation.Host.ChoiceDescription "&Yes",""
$no = New-Object System.Management.Automation.Host.ChoiceDescription "&No",""
$choices = [System.Management.Automation.Host.ChoiceDescription[]]($yes,$no)
$caption = "Confirming"
$message = "Save product key to a file?"
$result = $Host.UI.PromptForChoice($caption,$message,$choices,0)
$result
}
#Convert binary to serial number
Function ConvertToKey($Key)
{
$Keyoffset = 52
$isWin8 = [int]($Key[66]/6) -band 1
$HF7 = 0xF7
$Key[66] = ($Key[66] -band $HF7) -bOr (($isWin8 -band 2) * 4)
$i = 24
[String]$Chars = "BCDFGHJKMPQRTVWXY2346789"
do
{
$Cur = 0
$X = 14
Do
{
$Cur = $Cur * 256
$Cur = $Key[$X + $Keyoffset] + $Cur
$Key[$X + $Keyoffset] = [math]::Floor([double]($Cur/24))
$Cur = $Cur % 24
$X = $X - 1
}while($X -ge 0)
$i = $i- 1
$KeyOutput = $Chars.SubString($Cur,1) + $KeyOutput
$last = $Cur
}while($i -ge 0) $Keypart1 = $KeyOutput.SubString(1,$last)
$Keypart2 = $KeyOutput.Substring(1,$KeyOutput.length-1)
if($last -eq 0 )
{
$KeyOutput = "N" + $Keypart2
}
else
{
$KeyOutput = $Keypart2.Insert($Keypart2.IndexOf($Keypart1)+$Keypart1.length,"N")
}
$a = $KeyOutput.Substring(0,5)
$b = $KeyOutput.substring(5,5)
$c = $KeyOutput.substring(10,5)
$d = $KeyOutput.substring(15,5)
$e = $KeyOutput.substring(20,5)
$keyproduct = $a + "-" + $b + "-"+ $c + "-"+ $d + "-"+ $e
$keyproduct }
GetWin8Key

Step 3 – Provide a preferable name to the file and write extension .ps1 (remove .txt). For ex., If you write the name of the text file windowsbackupproductkey then its full name will be windowsbackupproductkey.ps1. Click Save to get the text file at your convenient location.

Backup Product Key of Windows 10, 8.1 and 8 pic 2

Step 4 – Right-click on the file and select Run with PowerShell on the list of menus.

Backup Product Key of Windows 10, 8.1 and 8 pic 3

Step 5 – Powershell will ask for your confirmation whether you will like to save a copy of product key on the desktop. Type Y and press Enter on your keyboard.

Backup Product Key of Windows 10, 8.1 and 8 pic 4

Step 6 – Go to your desktop and view the Backup Product Key of Windows 10, 8.1 and 8 saved in WindowsKeybackup.txt.

Backup Product Key of Windows 10, 8.1 and 8 pic 5

PowerShell Script to Backup Product Key of Windows 10, 8.1 and 8

Alternatively, download the PowerShell script for taking backup of Windows 10, 8 8.1 Product key from below.

Backup Product Key of Windows 10, 8.1 and 8 rar file download

Step 1 – Extract WindowsKeybackup.rar file, after you complete downloading.

Step 2 – Right click on windowsbackupproductkey.ps1 file and choose Run with PowerShell on the menu.

Step 3 – Type Y on the PowerShell and press Enter key.

Cheer up and view the Backup of Product Key of Windows 10, 8.1, and 8.

Summing up

So you can Backup Product Key of Windows 10, 8.1, and 8 using the above process in only 2 steps. After getting the backup you can store it to OneDrive by syncing the folder. Now you can easily reinsert the product key after reinstalling the OS.

You can follow this article to have a third party program for the same – Find Product Key of Windows/Office/Photoshop Using ProduKey on Windows 10

Sharing is caring    Share Whatsapp

 
Topics:  Windows 10
  
About Sunita
Love to play with Windows 11 and 10. Suggestion - Going for Registry change or system files edit then remember to take a backup or create a restore point before Starting.