How to get windows 7 cd key from command prompt or linux live disk?
No, you cannot do it from WinRE command line
Connect the non bootable drive to another Windows PC using a usb to hard drive adapter, install Product Key on the Host PC, run Product key and use File > Select Source.
When the new window opens tick the third radio button, browse to the Windows folder on the non boot drive and hit ok.
I've had really good success with the Magic Jelly Bean KeyFinder tool with MS-Windows 7 (32-bit and 64-bit editions), plus other versions of MS-Windows and most MS-Office products too:
Magic Jelly Bean KeyFinder
http://www.magicaljellybean.com/keyfinder/
It is possible to get the key from a Linux live disk (e.g. a Ubuntu Live DVD ), or any linux system that has access to the computer's drive (booted from usb, dual booted etc) - this may also be possible from another windows system without third party apps (example). Then you can get the licence by:
Get a registry reading/editing tool. I used
chntpw
, it is currently available in the Fedora and Ubuntu software repositories.Get the registry data. You will need the file that contains the registry data from
HKLM\SOFTWARE
, this should be located at/Windows/System32/config/SOFTWARE
(text case may vary, could be/WINDOWS/system32/config/SOFTWARE
etc). If you can read the hard disk this should be accessibleExtract the data. Run
chntpw
with the path to the registry file - e.g. with the windows partition mounted on/mnt
:chntpw -e /mnt/Windows/System32/config/SOFTWARE
And get the data from the
HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\DigitalProductId
key - you may be able to usedpi
command, otherwise you can read the key data directly usinghex Microsoft\Windows NT\CurrentVersion\DigitalProductId
.
If you don't succeed, you could check the hardware to see if it has the key embedded using the answers here. Or check for a sticker that came with the computer with the licence key written on.
Also if the Windows is a retail or OEM licence, you may just find a unique ID as the key is for use one time only.
More info:
chntpw
site probablychntpw
tutorial (for resetting passwords)- How to Geek - How to Find Your Lost Windows or Office Product Keys