A while back I wrote an article about a VB script that could pull your serial number / product key.
The problem with that is VB script has an issue with registry redirection on x64 versions of Windows. Under many installs of Windows 7/8/2012 (x64) that script will just get you a bunch of zeros.
Really there is no way around this in VB Script, it always wants to return those redirected keys. I would imagine it is possible to get around this in power shell, but that is for another article.
An even simpler way is to use ProduKey from Nirsoft:
It pulls product keys from any number of MS products…including the latest versions of Windows (8/2012).
It is free for commercial or personal use.
You can get it here:
Or from the Nirsoft website:
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