Windows产品密钥是很重要的一个密码,它是我们重新安装激活操作系统时必须要使用的,如果丢失或忘记了Windows产品密钥,将给我们带来很大的麻烦。
下面我将提供一个解决方案,你将看到如何使用简单的VBS脚本来显示已安装的Windows 10、Windows 8或Windows 7系统的产品密钥。这是从电脑上安装的操作系统中提取产品密钥的一个非常简单的解决方案,无需使用任何第三方软件。
与其它方法相比,这个VBScript解决方案几乎是完美的,用户只需要单击文件即可。
一、创建脚本文件
要查看电脑上安装的Windows 10产品密钥,请执行以下操作:
1.打开记事本。
2.将以下文本复制并粘贴到“记事本”窗口中:
Option Explicit Dim objshell,path,DigitalID, Result Set objshell = CreateObject(&34;) &34;HKLMSOFTWAREMicrosoftWindows NTCurrentVersion&39;Registry key value DigitalID = objshell.RegRead(Path & &34;) Dim ProductName,ProductID,ProductKey,ProductData &34;Product Name: &34;ProductName&34;Product ID: &34;ProductID&34;Installed Key: &39;Show messbox if save to a file If vbYes = MsgBox(ProductData & vblf & vblf & &34;, vbYesNo + vbQuestion, &34;) then Save ProductData End If &39;Check if OS is Windows 8 isWin8 = (Key(66) 6) And 1 Key(66) = (Key(66) And &HF7) Or ((isWin8 And 2) * 4) i = 24 Maps = &34; 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 >= 0 i = i -1 KeyOutput = Mid(Maps,Current+ 1, 1) & KeyOutput Last = Current Loop While i >= 0 If (isWin8 = 1) Then keypart1 = Mid(KeyOutput, 2, Last) insert = &34; KeyOutput = Replace(KeyOutput, keypart1, keypart1 & insert, 2, 1, 0) If Last = 0 Then KeyOutput = insert & KeyOutput End If ConvertToKey = Mid(KeyOutput, 1, 5) & &34; & Mid(KeyOutput, 6, 5) & &34; & Mid(KeyOutput, 11, 5) & &34; & Mid(KeyOutput, 16, 5) & &34; & Mid(KeyOutput, 21, 5) End Function &34;wscript.shell&39;Get current user name UserName = objshell.ExpandEnvironmentStrings(&34;) &34;C:Users&34;DesktopWindowsKeyInfo.txt&34;Scripting.FileSystemObject&win10玩机技巧#想了解更多精彩内容,快来关注@微课传媒
1.头条号【微课传媒】专注软件分享,如果你喜欢玩软件,欢迎关注、评论、收藏、转发。
2.在学习中有什么问题,欢迎与我沟通交流,今日头条号搜索【微课传媒】,我在这里等你哟!
免责声明:本文来自焦雅辉,不代表浮光掠影知识网 - 专注有价值知识的生活内容平台的观点和立场,如有侵权请联系本平台处理。
还没有评论,来说两句吧...