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. ...
随机推荐
- Asp.Net 5使用第三方容器
这几天在学习Asp.Net 5,现在文档以及博客之类的资料实在太少了,不看源码几乎举步维艰,好在全都是开源的,看看微软的代码也获益良多. 看到DependencyInjection的代码里除了默认的容 ...
- felx第二天 ActionScript 基本语法和关键字
flex中使用的注解有两种分别是:// 和/**/ flex使用的关键字如图
- 巧用Red Gate SQL Compare破解加密了的存储过程和函数
最近项目中遇到了一个遗留系统的存储过程和函数被加密了,网上找了半天,解决办法倒是有,但需要写一大堆脚本, 怕影响原系统的运行,就说先同步到其他服务器上去破解.没想到,打开Sql Compare一比 ...
- typedef的使用3——使用经过typedef定义的函数构成的函数数组
#include <stdio.h> #include <string.h>//不加还能跑,加上反而跑不了了...笑哭 #pragma warning(disable:4996 ...
- [置顶] c++类的继承(inheritance)
在C++中,所谓"继承"就是在一个已存在的类的基础上建立一个新的类.已存在的类(例如"马")称为"基类(base class )"或&quo ...
- Java8的新特性
Java 8主要新特性包括如下几点: 一.接口的默认方法和静态方法 Java 8版之前,接口只有抽象方法,而在Java 8,为接口新增了两种类型的方法. 第一种是默认方法:在Java 8中,可 ...
- [记录] web icon 字体
weloveiconfonts 在http://codepen.io/cguillou/pen/jmkfK 中看css发现既然有这样的,yes!
- Linux - 查看用户登录记录
有关用户登录的信息记录在 utmp(/var/run/utmp).wtmp(/var/log/wtmp).btmp(/var/log/btmp) 和 lastlog(/var/log/lastlog) ...
- 爬虫遇到取到网页为reload的问题
有的网站防采集,会在页面加上this.window.location.reload(),这时候你就会得到如下代码: <html> <head> <meta ...
- .NET 4 新建 webform 项目编译不通过
.NET 4 新建 webform 项目编译不通过,可能需要做如下改动. 一.根据编译错误,删除 packages.config 中相关包 二.安装包install-package Microsoft ...