Get your Windows product key from a script
The product key is located in the registry under
HKLM\Software\Microsoft\Windows NT\CurrentVersion
It is the value named: DigitalProductId
If you look at it, you will realize it is encrypted:
That is what his script takes care of. It reverses the simple XOR encryption and turns that numeric mess into a readable product key.
cscript serial.vbs
save the following code to serial.vbs
'*****************************************
'* Script Usage: Get Windows Product Key *
'* http://www.intelliadmin.com *
'* Revision 8/15/2012 *
'***************************************** 'Constants for our registry query
const HKEY_LOCAL_MACHINE = &H80000002
sRegistryKeyName = "SOFTWARE\Microsoft\Windows NT\CurrentVersion"
sRegistryValueName = "DigitalProductId" function GetProductKey
'Get the raw product key data
dim pValues()
Set poRegistry=GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\default:StdRegProv")
poRegistry.GetBinaryValue HKEY_LOCAL_MACHINE,sRegistryKeyName,sRegistryValueName,pValues Dim sArrayPID
sArrayPID = Array() 'In that data, positions 52-66 contain our product id info
'We copy to an array so we can decrypt For i = to
'Increase our array size by one
ReDim Preserve sArrayPID( UBound(sArrayPID) + )
'Insert our value into the end if the array
sArrayPID(UBound(sArrayPID)) = pValues(i)
Next 'Consants for our product key
Dim sProductKeyChars
sProductKeyChars = Array("B","C","D","F","G","H","J","K","M","P","Q","R","T","V","W","X","Y","","","","","","","") For i = To Step -
k =
For j = To Step -
k = k * Xor sArrayPID(j)
sArrayPID(j) = Int(k / )
k = k Mod
Next
sProductKey = sProductKeyChars(k) & sProductKey
'Adds the - between the key sections
if i Mod = And i <> Then sProductKey = "-" & sProductKey
Next
GetProductKey = sProductKey
end function function GetOSVersion
Set SystemSet = GetObject("winmgmts:").InstancesOf ("Win32_OperatingSystem")
for each System in SystemSet
GetOSVersion = Trim(System.Caption) & " (" & System.Version & ")"
next
end function wscript.echo GetOSVersion & ", " & GetProductKey
reference:
http://www.intelliadmin.com/index.php/2012/08/get-your-windows-product-key-from-a-script/
Get your Windows product key from a script的更多相关文章
- Microsoft Office 2013 Product Key
Microsoft Office 2013 Product Key ( Professional Plus ) PGD67-JN23K-JGVWW-KTHP4-GXR9G B9GN2-DXXQC-9D ...
- 如何更换Office 2013的product key?
第一步 第二步 第三步 ... ... ... ... ^_^ 参考资料 ======================== Change Product Key Office 2013 Home ...
- Windows Office key 持续更新地址
微软 Windows Office 系列序列号,每日都有更新,上面显示的基本都可用,包括MAK及Retail Key. Windows 10 http://textuploader.com/52 ...
- 自定义针对Product Key处理的TextBox
代码: using System; using System.Collections.Generic; using System.Linq; using System.Text; using Syst ...
- 【jenkins】【java】【tomcat】windows host key verification failed
适用于windows系统 出现这个问题的原因tomcat启动的用户找不到本地公私钥路径 如果tomcat 启动时候选择 local system account (默认此选项),请把你的公私钥文件(i ...
- VS2017 Product Key
Enterprise: NJVYC-BMHX2-G77MM-4XJMR-6Q8QF Professional: KBJFW-NXHK6-W4WJM-CRMQB-G3CDH
- 使用slmgr查看、删除windows 授权(key)
查看 slmgr.vbs /dlv 删除授权 使用管理员权限进入cmd All program -> accessories -> Command Prompt (右键 已管理员方式运行) ...
- vs2019 product key
Visual Studio 2019 Enterprise BF8Y8-GN2QH-T84XB-QVY3B-RC4DF Visual Studio 2019 Professional NYWV ...
- KMS服务器激活Windows和Office2013EnterprisePlus
KMS服务器激活Windows和Office2013EnterprisePlus 参考了文档 http://wenku.baidu.com/view/0cb2602358fb770bf68a5501. ...
随机推荐
- Java基础知识强化之网络编程笔记19:Android网络通信之 HttpClient和传统Post、Get方式的区别
1. HttpClient是什么 ? HTTP 协议可能是现在 Internet 上使用得最多.最重要的协议了,越来越多的 Java 应用程序需要直接通过 HTTP 协议来访问网络资源.虽然在 ...
- 深入浅出ECharts系列(一)地图+散点图
深入浅出ECharts系列(一) 目标 本次教程的目标是实现“微博签到点亮中国”散点图,实现结果如图: 2. 准备工作 a) 首先下载ECharts插件,你可以根据自己的实际需求选择你 ...
- nyoj 86 找球号(一)
找球号(一) 时间限制:3000 ms | 内存限制:65535 KB 难度:3 描述 在某一国度里流行着一种游戏.游戏规则为:在一堆球中,每个球上都有一个整数编号i(0& ...
- Java基础环境搭建
- FileReader 的了解
FileReader的解释 异步的读取存储在用户计算机上的文件 创建一个FileReader 对象 var reader = new FileReader(); FileReader的方法和事件 参数 ...
- JAXB - XML Schema Types, Defining Subtypes
Although object orientation isn't a key feature of XML or the XML Schema language, it's still possib ...
- build-essential
- ios Swift 资源池
Swift入门教程: http://www.cocoachina.com/applenews/devnews/2014/0604/8661.html Swift视频教程: http://www.coc ...
- 自定义函数实现NULL值替换
数据库环境:SQL SERVER 2005 有时候,想将查询查询数来的数据格式化一下,不希望显示NULL值,或者复制表的数据时,被插入的表不允许有NULL. 我们可以通过ISNULL()函数或者COA ...
- 【SQL】MySQL学习笔记1-----子查询
1.什么叫子查询? 通俗的讲就是查询中有查询,SQL语句中有多个select语句. 2.什么地方可以嵌入子查询? SELECT 列 (不在标准之内) FROM 表 (可以嵌入,作为表存在) WHERE ...