📜  如何找到 Windows 10 产品密钥 (1)

📅  最后修改于: 2023-12-03 15:38:47.250000             🧑  作者: Mango

如何找到 Windows 10 产品密钥

介绍

在安装 Windows 10 时,需要输入产品密钥来激活操作系统。但是很多用户常常会忘记保存自己的产品密钥,导致需要重新安装系统时出现困难。本文将介绍几种方法来找到Windows 10的产品密钥。

方法一:使用脚本

在Windows 10系统中,可以通过使用命令行脚本来获取系统的产品密钥。以下是操作步骤:

  1. 打开Notepad(记事本)
  2. 将下面的代码粘贴到记事本中
Set WshShell = CreateObject("WScript.Shell")
MsgBox ConvertToKey(WshShell.RegRead("HKLMSOFTWAREMicrosoftWindowsNTCurrentVersionDigitalProductId"))

Function ConvertToKey(Key)
    Const KeyOffset = 52
    Dim isWin8, Maps, i, j, Current, KeyOutput, Last, keypart1, insert
    'Check if OS is Windows 8
    isWin8 = (Key(66)  6) & 1
    Key(66) = (Key(66) & 247) Or ((isWin8 And 2) * 4)
    i = 24
    Maps = "BCDFGHJKMPQRTVWXY2346789"
    Do
        Current= 0
        j = 14
        Do
            Current = Current  256
            Current = Key(j + KeyOffset) + Current
            Key(j + KeyOffset) = (Current \ 24)
            Current=Current Mod 24
            j = j -1
        Loop While j = 14
        i = i -1
        KeyOutput = Mid(Maps,Current+1,1) & KeyOutput
        Last = Current
    Loop While i >= 0
    keypart1 = Mid(KeyOutput, 2, Last)
    insert = "N"
    KeyOutput = Replace(KeyOutput, keypart1, keypart1 & insert, 2, 1, 0)
    If Last = 0 Then KeyOutput = insert & KeyOutput
    ConvertToKey = Mid(KeyOutput, 1, 5) & "-" & Mid(KeyOutput, 6, 5) & "-" & Mid(KeyOutput, 11, 5) & "-" & Mid(KeyOutput, 16, 5) & "-" & Mid(KeyOutput, 21, 5)
End Function
  1. 将以上代码保存为“getWin10Key.vbs”文件
  2. 双击运行脚本文件
  3. 一个包含Windows 10产品密钥的对话框将出现
方法二:使用PowerShell命令

另外一种获取Windows 10产品密钥的方法是使用PowerShell命令。操作步骤:

  1. 打开Windows PowerShell(管理员权限)
  2. 输入以下命令并运行
powershell "(Get-WmiObject -query ‘select * from SoftwareLicensingService’).OA3xOriginalProductKey"
  1. 之后将返回包含Windows 10产品密钥的字符串。
方法三:查看Windows 10本地账户信息

如果您在安装Windows 10系统之前曾使用本地账户登录,则可以通过以下步骤找到您的产品密钥:

  1. 打开设置(Win+I)
  2. 点击“账户”选项卡
  3. 在左侧面板中,选择“您的信息”
  4. 此处会显示您的电脑/设备的名称,以及与您的本地帐户关联的电子邮件地址。
  5. 在"管理您的账户"部分,点击"查看Microsoft Store购买历史记录"。
  6. 如果之前购买过Windows 10系统,则相应的产品密钥会在此处显示出来。
总结

通过以上三种方法,您可以很容易地找到Windows 10的产品密钥。值得注意的是,如果您未激活Windows 10系统,那么您可能需要一个合法的产品密钥来完成激活。因此,建议在安装Windows 10时保存好您的产品密钥。