设置
  • 日夜间
    随系统
    浅色
    深色
  • 主题色

Win7/Win8.1全新安装Win10必备:密钥一键查询备份

2016/7/28 10:35:53 来源:IT之家 作者:晨风 责编:晨风

2016年7月29日,微软关闭Win7/Win8.1免费升级Win10的通道,本文发稿时间为关闭前一天,此时如果还有用户想升级Windows10但没有升级的,可以尝试使用本文方法进行全新安装。全新安装的好处就是不会产生新旧系统各种衔接不畅的问题,虽说现在升级安装Win10后的体验不像一年前那么差了,但这种本质性的差异是Windows系统升级安装的通病,很难避免。

当然,免费激活这事可能还是直接升级的更保险,因为一般来说升级之前的系统都是激活好了的,虽然大家激活系统方式可谓“条条大路通罗马”吧,但微软一般也没计较什么,都给予了激活状态的Win10。不过使用全新安装再输入产品密钥的方式可能更适合正版用户,或者自己手中有合法密钥(至少密钥没被封禁)的用户。如果你能够确认手中的密钥没有问题,不妨尝试一下IT之家的方法。操作上很简单,只需要把如下代码使用记事本等保存为.vbs格式(文件名自拟),双击运行即可,适用于Win7/Win8.1/Win10系统。

图片说明:这幅图的意思并非企业版支持免费升级,而是说本文方法同样适用于企业版密钥查询和备份

代码如下:

Option Explicit

Dim objshell,path,DigitalID, Result

Set objshell = CreateObject("WScript.Shell")

'Set registry key path

Path = "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\"

'Registry key value

DigitalID = objshell.RegRead(Path & "DigitalProductId")

Dim ProductName,ProductID,ProductKey,ProductData

'Get ProductName, ProductID, ProductKey

ProductName = "系统名称:" & objshell.RegRead(Path & "ProductName")

ProductID = "产品ID:" & objshell.RegRead(Path & "ProductID")

ProductKey = "已安装密钥:" & ConvertToKey(DigitalID)

ProductData = ProductName & vbNewLine & ProductID & vbNewLine & ProductKey

'Show messbox if save to a file

If vbYes = MsgBox(ProductData & vblf & vblf & "要将密钥保存到文件吗?", vbYesNo + vbQuestion, "软媒魔方备份Windows密钥信息") then

Save ProductData

End If

'Convert binary to chars

Function ConvertToKey(Key)

Const KeyOffset = 52

Dim isWin10, Maps, i, j, Current, KeyOutput, Last, keypart1, insert

'Check if OS is Windows 10

isWin10 = (Key(66) \ 6) And 1

Key(66) = (Key(66) And &HF7) Or ((isWin10 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 >= 0

i = i -1

KeyOutput = Mid(Maps,Current+ 1, 1) & KeyOutput

Last = Current

Loop While i >= 0

If (isWin10 = 1) Then

keypart1 = Mid(KeyOutput, 2, Last)

insert = "N"

KeyOutput = Replace(KeyOutput, keypart1, keypart1 & insert, 2, 1, 0)

If Last = 0 Then KeyOutput = insert & KeyOutput

End If

ConvertToKey = Mid(KeyOutput, 1, 5) & "-" & Mid(KeyOutput, 6, 5) & "-" & Mid(KeyOutput, 11, 5) & "-" & Mid(KeyOutput, 16, 5) & "-" & Mid(KeyOutput, 21, 5)

End Function

'Save data to a file

Function Save(Data)

Dim fso, fName, txt,objshell,UserName

Set objshell = CreateObject("wscript.shell")

'Get current user name

UserName = objshell.ExpandEnvironmentStrings("%UserName%")

'Create a text file on desktop

fName = "C:\Users\" & UserName & "\Desktop\Windows密钥备份.txt"

Set fso = CreateObject("Scripting.FileSystemObject")

Set txt = fso.CreateTextFile(fName)

txt.Writeline Data

txt.Close

End Function

----------- IT之家分割线 ------------

图片说明:代码粘贴到记事本后,另存为.vbs格式

图片说明:运行效果,备份密钥会以文本文件(.txt)的形式保存到桌面

图片说明:保存密钥文件的内容

当然,自己手动新建文件,复制和粘贴代码再保存怪麻烦的,所以各位直接在下方下载现成的文件就省心了,下来之后直接运行。

Windows 产品密钥查询备份文件:网盘下载(2KB)

另外,软媒魔方点击下载)也有Win7/Win8.1以及Office产品密钥备份激活功能,无需记住密钥,而且可以直接在魔方中还原激活,有需要的用户可以下载使用。

Win10一周年更新版如何激活?点此查看激活秘笈。

广告声明:文内含有的对外跳转链接(包括不限于超链接、二维码、口令等形式),用于传递更多信息,节省甄选时间,结果仅供参考,IT之家所有文章均包含本声明。

相关文章

软媒旗下网站: IT之家 辣品 - 超值导购,优惠券 最会买 - 返利返现优惠券 iPhone之家 Win7之家 Win10之家 Win11之家

软媒旗下软件: 魔方 云日历 酷点桌面 Win7优化大师 Win10优化大师 软媒手机APP应用