HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion?\ProductKey?
Manual Way
find "ProductKey" c:\windows\system.dat
More Automation
@echo off
start /w regedit /e key.txt HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion
type key.txt|find "ProductKey">mykey.txt
del key.txt