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的更多相关文章

  1. Microsoft Office 2013 Product Key

    Microsoft Office 2013 Product Key ( Professional Plus ) PGD67-JN23K-JGVWW-KTHP4-GXR9G B9GN2-DXXQC-9D ...

  2. 如何更换Office 2013的product key?

    第一步 第二步 第三步 ... ... ... ... ^_^   参考资料 ======================== Change Product Key Office 2013 Home ...

  3. Windows Office key 持续更新地址

    微软 Windows  Office 系列序列号,每日都有更新,上面显示的基本都可用,包括MAK及Retail Key. Windows 10   http://textuploader.com/52 ...

  4. 自定义针对Product Key处理的TextBox

    代码: using System; using System.Collections.Generic; using System.Linq; using System.Text; using Syst ...

  5. 【jenkins】【java】【tomcat】windows host key verification failed

    适用于windows系统 出现这个问题的原因tomcat启动的用户找不到本地公私钥路径 如果tomcat 启动时候选择 local system account (默认此选项),请把你的公私钥文件(i ...

  6. VS2017 Product Key

    Enterprise: NJVYC-BMHX2-G77MM-4XJMR-6Q8QF Professional: KBJFW-NXHK6-W4WJM-CRMQB-G3CDH

  7. 使用slmgr查看、删除windows 授权(key)

    查看 slmgr.vbs /dlv 删除授权 使用管理员权限进入cmd All program -> accessories -> Command Prompt (右键 已管理员方式运行) ...

  8. vs2019 product key

    Visual Studio 2019 Enterprise BF8Y8-GN2QH-T84XB-QVY3B-RC4DF     Visual Studio 2019 Professional NYWV ...

  9. KMS服务器激活Windows和Office2013EnterprisePlus

    KMS服务器激活Windows和Office2013EnterprisePlus 参考了文档 http://wenku.baidu.com/view/0cb2602358fb770bf68a5501. ...

随机推荐

  1. hadoop学习记录(零)

    这个博客开通快一年了,但是由于种种原因,始终没有能够养成定期更新的习惯. 最近完成了比赛的项目,向除了android开发以外再拓宽一下自己的技能树. 最近购买了<java8函数式编程>和& ...

  2. failed to obtain a cell from its dataSource

    stroyboard没有绑定标示 没有注册标示 cell为空时没有创建

  3. 虚拟机CentOS联网相关配置

    CentOS 用ifconfig命令,只有lo,没有eth0的解决方案 如果ifconfig -a 也没发现eth0则拷贝lo自己造一个,CentOS7 命令为 ip addr 1.配置虚拟机如下图: ...

  4. 关于Http协议的解析

    HTTP概述 HTTP(hypertext transport protocol),即超文本传输协议.这个协议详细规定了浏览器和万维网服务器之间互相通信的规则. HTTP就是一个通信规则,通信规则规定 ...

  5. centos 7访问windows共享文件夹

    1. 首先centos要能识别win7的文件系统ntfs,原版的centos是不支持NTFS格式的文件系统,因此需要安装ntfs支持软件包,我使用的是rpmforge软件库,在此处http://pkg ...

  6. (总结)CentOS Linux下VNC Server远程桌面配置详解

    一.安装相应桌面环境与vnc服务端和客户端: # yum groupinstall "GNOME Desktop Environment"(CentOS 5.x安装GNOME桌面环 ...

  7. CSS 基本知识

    1.CSS 简介 CSS 指层叠样式表 (Cascading Style Sheets),是一种用来表现 HTML 文档样式的语言,样式定义如何显示 HTML 元素,是能够真正做到网页表现与结构分离的 ...

  8. IE, FF, Safari前端开发常用调试工具

    一些前端开发 IE 中的常用调试工具: Microsoft Script Debugger —— Companion.JS need to install this Companion.JS —— J ...

  9. coding

    public class zengzhiwei { public static void main(String args[]) { int i; System.out.println("h ...

  10. (转)(contant的一些用法)

    主要就是增加约束的 以下几种约束 .并 一一列举: 1.主键约束:要对一个列加主键约束的话,这列就必须要满足的条件就是分空因为主键约束:就是对一个列进行了约束,约束为(非空.不重复)以下是代码  要对 ...