If you can’t find the Windows key you bought, it would be worth it if you could restore it by using it on your computer. But, there is no easy way to do it from Windows itself. Even if you do this by heart in Windows XP, it is certain that no one will remember a Windows 10 Key. In this article, we bring some methods for that.
License Key Types
Microsoft has introduced several types of License Keys. Depending on how they are issued, they vary as follows.
· OEM – These are wholesalers to computer manufacturers (Original Equipment Manufacturers). They are sent one by one per computer. Once activated (mostly they do it themselves) it cannot be applied again to another computer. On some modern computers, the UEFI/BIOS automatically applies these during Windows installation.
· Retail – As the name suggests, those that can be purchased at retail. We can purchase these from Microsoft or another authorized representative. These are priced slightly higher than the bulk price, with Rs. 10,000 – 20,000 or more (depending on the type of volume).
· Digital – Retails Keys are called by this name in online activation of Windows 10. They are often associated with a Microsoft account. Sometimes, those provided through services such as BizPark, and those received during free upgrades from Windows 7/8 are also considered in this category.
You can check the type of your key by going to Settings > Update & Security > Activation.
Through the Command Prompt

To view the license key, you can use the CLI program provided by Microsoft to use the Windows Management Instrumentation service. It is called wmic.exe and can be run through Command Prompt. For this you may need an account with administrator permission.
Windows Key + R to get the Run command box. Type “cmd” and press Enter to open the Command Prompt. Then, copy the following command and right-click on the CMD. Then it will be pasted.
Wmic path softwarelicensingservice get OA3xOriginalProductKey
Now when the Enter key is pressed, the License Key will appear.
By means of PowerShell

Even if the Windows Management Instrumentation service is used for this, the code to be provided changes. It obtains the license key from WmiObject through a SQL-like query code. For this, you may need an account with administrator permission.
Right-click the Start button, and then click Windows PowerShell (Admin). Then, copy the following code and right-click on CMD. Then it will be pasted.
(Get-WmiObject -query ‘select * from SoftwareLicensingService’).OA3xOriginalProductKey
Now when the Enter key is pressed, the License Key will appear.
If you want to run this in Command Prompt, change PowerShell to “(Get-WmiObject -query ‘select * from SoftwareLicensingService’).OA3xOriginalProductKey”. The commands given in the above sections for CMD are also valid for PowerShell.
By a VBS file

Although the license key is stored in the registry, it cannot be seen directly because it is in binary. There is a VBS code that can convert it into text and take care of the key with a single click instead of the CLI commands given above.
Open Notepad to edit the file. Copy and paste the following code there.
Set WshShell = CreateObject(“WScript.Shell”)
MsgBox ConvertToKey(WshShell.RegRead(“HKLMSOFTWAREMicrosoftWindows NTCurrentVersionDigitalProductId”))
Function ConvertToKey(Key)
const KeyOffset = 52
i = 28
Chars = “BCDFGHJKMPQRTVWXY2346789”
Do
Cur = 0
x = 14
Do
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
End If
Loop While i >= 0
ConvertToKey = KeyOutput
End Function
Now go to File > Save As and give All Files as Save As Type, and save with the desired File Name and .vbs (eg showlicensekey.vbs). Now when the file is opened, the key will appear in a dialog box.
Other software that may be used
You can easily use the following software to view the license key.
ShowKeyPlus – This can be downloaded from the Microsoft Store. It costs 5.8 MB to download. It has many other features such as the type of Windows volume, and the ability to type a key and see what the volume is.
· NirSoft – Windows as well as the key is given to the office package can be taken care of here. This data is also obtained from the Registry. The download costs as little as 63 KB of data.
· Windows 10 OEM Product Key Tool – This is from NeoSmart, makers of wonderful software like EasyBCD. Although it does not have many features, it shows the key in a dialog box just like the VBS we set up. It can also be copied. It costs 1.38 MB to download.
If you are interested in the VBS script rather than a third-party software or CLI command, you should definitely check out the article on some fun things you can do with Notepad. It has many scripts like how to make the computer talk and how to open the CD ROM drive.