Perhaps you already tried to obtain Windows 10 key from CMD with a command you found on the Internet, but it did not work. I had the same problem. CMD simple did not work. I got blank output. So I tried to look for different solution. Below, I present a solution that worked for me.

Extract Windows 10 activation key from OS with a VBS script.

If you need to get a Windows 10 key, you are in luck. Simply save the script below with “.vbs” extension. Then double-click on the file. The key will appear in windows prompt.

Set WshShell = CreateObject("WScript.Shell")
MsgBox ConvertToKey(WshShell.RegRead("HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\DigitalProductId"))

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

Src: https://www.howtogeek.com/660517/how-to-find-your-windows-10-product-key-using-the-command-prompt/

0
Would love your thoughts, please comment.x
()
x