How To Recover Windows 10/8/7 Product Key Without Using Third-Party Tools

How To Recover Windows 10/8/7 Product Key Without Using Third-Party Tools

There are times when you may want to recover your Windows product key from a working Windows installation, whether to back up the product key before beginning to install a newer version of Windows, or to reinstall existing version of Windows operating system. The standard or the popular way of retrieving Windows product key is to use a third-party software such as License Crawler or use a free Windows product key recovery CD to recover the product key from unbootable PCs. While there are plenty of free tools available for this job, the fact is that one can recover Windows product key from registry without having to use third-party tools. Out friend at WinAero has posted a helpful guide on recovering Windows product key without using third-party tools. The only thing is that your PC must be bootable to recover the product key using this method. And if your PC is unbootable, follow our how to recover Windows 7/8/8/8.1 product key from unbootable PC guide. NOTE: This method works in all recent versions of Windows, including Windows 7, Windows 8, and Windows 8.1. Step 1: Copy the following code and paste it into Notepad. Save the file as RecoverKey.ps1 on your desktop. Note that it’s important to save the file with .ps1 extension. function Get-WindowsKey { ## function to retrieve the Windows Product Key from any PC ## by Jakob Bindslet (jakob@bindslet.dk) param ($targets = “.”) $hklm = 2147483650 $regPath = “SoftwareMicrosoftWindows NTCurrentVersion” $regValue = “DigitalProductId” Foreach ($target in $targets) { $productKey = $null $win32os = $null $wmi = [WMIClass]”\$targetrootdefault: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 $obj } } Step 2: Open Windows PowerShell as administrator. To do this, you can type Windows PowerShell in the Start menu (Windows 7) or Start screen (Windows 8/8.1), and then simultaneously press Ctrl + Shift + Enter keys. Alternatively, you can right-click on the Windows 8.1 Start button and then click Windows PowerShell (Admin) to launch PowerShell as administrator. Click on the Yes button when you see the User Account Control (UAC) dialog. Step 3: In the PowerShell window, type the following code (or you can simply copy and paste) and press Enter key to change the execution policy for non-signed scripts. Set-ExecutionPolicy RemoteSigned Click Enter key or ‘Y’ key when you see “Do you want to change the execution policy” message. Step 4: Finally, type the following command and then press Enter key to view your Windows product key. That’s it! Import-Module C:UsersPCDesktopRecoverKey.ps1; Get-WindowsKey In the above command, replace “C:UsersPCDesktopRecoverKey.ps1” with the path to the previously saved RecoverKey.ps1 file. To easily get the path, press and hold down the Shift key, right-click on RecoverKey.ps1 file, and then click Copy as path option. Good luck!

Leave a Reply

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