One of the laptops that I regularly use is a MacBook Pro. It runs the latest and greatest OS X version along with BootCamp and Windows 7. For those of you unfamiliar with BootCamp, it basically just allows you to dual-boot your Mac laptop and switch between OS X or Windows.
Since Windows 8 has been officially released, I decided to rebuild my MacBook Pro from scratch and use BootCamp to install Windows 8. If I liked it, I would keep it. If not, I would redo BootCamp and put Windows 7 back in place.
However, since the previous install of Windows 7 was a digital download and I seem to have misplaced my email receipt that contained my Windows Product Key, if I decided to switch back to Windows 7, I would not be able to activate it without some difficulties.
I did some searching online for a tool to identify your current product key and found Magical Jelly Bean. It’s an app that you install in Windows and it reveals your key. Pretty simple.
But what if you don’t have access to the internet or you simply don’t want to install an unknown app just to get your key?
Powershell to the rescue!
Run the Powershell code below to generate your Windows Product Key. Quick and Easy:
function get-windowsproductkey([string]$computer) { $Reg = [WMIClass] ("\\" + $computer + "\root\default:StdRegProv") $values = [byte[]]($reg.getbinaryvalue(2147483650,"SOFTWARE\Microsoft\Windows NT\CurrentVersion","DigitalProductId").uvalue) $lookup = [char[]]("B","C","D","F","G","H","J","K","M","P","Q","R","T","V","W","X","Y","2","3","4","6","7","8","9") $keyStartIndex = [int]52; $keyEndIndex = [int]($keyStartIndex + 15); $decodeLength = [int]29 $decodeStringLength = [int]15 $decodedChars = new-object char[] $decodeLength $hexPid = new-object System.Collections.ArrayList for ($i = $keyStartIndex; $i -le $keyEndIndex; $i++){ [void]$hexPid.Add($values[$i]) } for ( $i = $decodeLength - 1; $i -ge 0; $i--) { if (($i + 1) % 6 -eq 0){$decodedChars[$i] = '-'} else { $digitMapIndex = [int]0 for ($j = $decodeStringLength - 1; $j -ge 0; $j--) { $byteValue = [int](($digitMapIndex * [int]256) -bor [byte]$hexPid[$j]); $hexPid[$j] = [byte] ([math]::Floor($byteValue / 24)); $digitMapIndex = $byteValue % 24; $decodedChars[$i] = $lookup[$digitMapIndex]; } } } $STR = '' $decodedChars | % { $str+=$_} $STR } get-windowsproductkey .
My spouse and I stumbled over here coming from a different page and thought I
might as well check things out. I like what I
see so now i’m following you. Look forward to looking at
your web page for a second time.