如何在 Windows 中查看产品密钥

很多升级到 Windows 10 的人都遇到了一个奇怪的问题。他们找不到产品密钥。现在,产品密钥是你解释你的真实性到 Windows。但 Windows 10 提出了一种识别用户真实性的新方法,那就是数字授权。数字授权中包含什么样的系统足迹仍不清楚。但是,在本文中,我将向您展示如何找到产品密钥在任何版本的 Windows 中。

如何使用 powershell 命令查看 windows 产品密钥

只需以管理员身份打开 powershell 并运行下面给出的命令。

Get-WMIObject -Class SoftwareLicensingService | Select-Object -Property *

如何查看 Windows 产品密钥

步骤 1 – 将下面给出的代码复制并粘贴到记事本中。

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

第2步– 现在,将所有文件另存为名称为 key.vbs 的文件在您的桌面或任何您想要的地方。

步骤3– 现在,双击它,您将在对话框中看到产品密钥。