admin管理员组

文章数量:1586245

命令提示符查找文件

If you’re looking for your Windows 10 product key, you can find it by entering a quick command in the Command Prompt. Here’s how—plus a neat little trick for finding the product key using a Windows Registry method.

如果要查找Windows 10产品密钥,可以通过在命令提示符中输入快速命令来找到它。 这是方法,以及使用Windows Registry方法查找产品密钥的巧妙技巧。

使用命令提示符查找Windows 10产品密钥 (Find Your Windows 10 Product Key Using the Command Prompt)

To find your Windows 10 product key using the Command Prompt, you’ll need to open the command line application with administrative privileges. To do this, type “cmd” in the Windows search bar.

要使用命令提示符查找Windows 10产品密钥,您需要使用管理权限打开命令行应用程序 。 为此,请在Windows搜索栏中键入“ cmd”。

Command Prompt will appear in the search results. Right-click it and select “Run As Administrator” from the window that appears. If prompted, enter your Windows account password.

命令提示符将出现在搜索结果中。 右键单击它,然后从出现的窗口中选择“以管理员身份运行”。 如果出现提示,请输入Windows帐户密码。

Once open, copy and paste the following command and then hit the Enter key:

打开后,复制并粘贴以下命令,然后按Enter键:

wmic path softwarelicensingservice get OA3xOriginalProductKey

The 25-digit product key will then appear.

然后将显示25位产品密钥。

Note: This method displays the Windows product key stored in your computer’s BIOS or UEFI firmware. In other words, it shows the original Windows key your computer came with. If you’ve installed Windows with a different key since then (or acquired a digital license), it will be different from the current key in use on your PC. If you want the current key in use on your PC, NirSoft’s ProduKey is a good graphical tool for finding it.

注意 :此方法显示存储在计算机的BIOS或UEFI固件中的Windows产品密钥。 换句话说,它显示计算机附带的原始Windows密钥。 从那时起,如果您使用其他密钥安装Windows(或获得了数字许可证 ),则它将与PC上当前使用的密钥不同。 如果要在PC上使用当前密钥, NirSoft的ProduKey是查找它的理想图形工具。

That’s all there is to it. This way is quick, but this isn’t likely a code you’ll remember very easily. If you’d like a faster way of accessing your product key in the future, you can use the Windows Registry method instead.

这里的所有都是它的。 这种方法很快,但是您不太容易记住该代码。 如果您希望将来有一种更快的方法来访问产品密钥,则可以改用Windows Registry方法。

使用Windows注册表方法查找Windows 10产品密钥 (Find Your Windows 10 Product Key Using a Windows Registry Method)

Update: This method is all over the web, but it doesn’t seem to return a real usable key on the latest version of Windows 10. (For example, this script in Microsoft’s TechNet gallery works differently, but also grabs output from “DigitalProductId” in the registry.) As of July 2020, we recommend you skip this section and use the above method instead.

更新 :此方法遍及整个网络,但似乎未在最新版本的Windows 10上返回真实的可用密钥。(例如, Microsoft TechNet画廊中的此脚本的工作方式有所不同,但还会从“ DigitalProductId”中获取输出自2020年7月起,建议您跳过本节,改用上述方法。

The Windows Registry tip was initially posted by a user (whose account is no longer active) in the Microsoft forum.

Windows注册表提示最初由用户(该帐户不再处于活动状态)发布在Microsoft论坛中 。

First, open Notepad by right-clicking anywhere on the desktop, hovering over “New,” and then selecting “Text Document” from the menu.

首先,右键单击桌面上的任意位置,将鼠标悬停在“新建”上,然后从菜单中选择“文本文档”,以打开记事本。

Copy and paste this code into Notepad:

将此代码复制并粘贴到记事本中:

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

Next, click the “File” tab and select “Save As.”

接下来,单击“文件”选项卡,然后选择“另存为”。

In File Explorer, set the “Save As Type” dropdown to “All Files” and give your file a name. You can use any name, but it has to be a .vbs file. You can name it something like: productkey.vbs

在文件资源管理器中,将“另存为类型”下拉列表设置为“所有文件”,并为文件命名。 您可以使用任何名称,但必须是.vbs文件 。 您可以将其命名为: productkey.vbs

Once you’ve entered a file name, save the file.

输入文件名后,保存文件。

You can now view your Windows 10 product key at any time by opening the new file.

现在,您可以通过打开新文件随时查看Windows 10产品密钥。

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

命令提示符查找文件

本文标签: 命令提示符密钥如何使用文件产品