A while back Stacy asked:
“Hi Steve. I was wondering if you knew of a way to get a windows product key from a script. I need it because we are trying to audit our windows licensing, and see if we have any duplicate keys”
And by coincidence, I got this email from Matthew P:
“Do you guys have a quick tool to see what model a computer is?
Just as soon as I typed this I remembered I already have a tool for this sort of thing, and I’m attaching it now…”
The real gem in Matthew’s script is the ability to pull out a Windows product key.
This info is located in the registry under
It is the value named:
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.
You can get the script from here:
Just rename to .vbs, and it outputs the OS version, and key to the console.
One more thing…Subscribe to my newsletter and get 11 free network administrator tools, plus a 30 page user guide so you can get the most out of them. Click Here to get your free tools