Every virtual commercial product available for purchase usually comes with an activation code you mustn’t share with anyone. It’s the basic method of preventing theft and even Windows does it.
Just like everything else, there’s some chance that you can lose, at least temporarily, the piece of paper, card, or whatever the product key is written on. Although recent Windows iterations get installed without necessarily writing the product code, but it’s required for activation to use all of its features later on.
Microsoft didn’t implement any kind of utility or feature that displays the product key, but as seen on the web, there’s a sneaky way to bypass this issue. Whether you lost it or want to keep it safe for a fresh install of Windows, these are a few methods you can use to find the product key.
Creating a script to fetch the key
Step 1: Create a new plain Text Document under whatever name you consider fit.
Step 2: Open the document and paste the following code:
Set WshShell = CreateObject("WScript.Shell")
MsgBox ConvertToKey(WshShell.RegRead("HKLMSOFTWAREMicrosoftWindows NTCurrentVersionDigitalProductId"))
Const KeyOffset = 52
i = 28
Chars = "BCDFGHJKMPQRTVWXY2346789"
Cur = 0
x = 14
Cur = Cur * 256
Cur = Key(x + KeyOffset) + Cur
Key(x + KeyOffset) = (Cur 24) And 255
Cur = Cur Mod 24
x = x -1
Loop While x >= 0
i = i -1
KeyOutput = Mid(Chars, Cur + 1, 1) & KeyOutput
If (((29 - i) Mod 6) = 0) And (i <> -1) Then
i = i -1
KeyOutput = "-" & KeyOutput
Loop While i >= 0
ConvertToKey = KeyOutput