MICRO CENTER: COMPUTERS AND ELECTRONICS
Random Access   chris, kp & rob
Speak Geek
Lost Product Key
by chris

"I've done it again, crashed my PC with a Win 98 system but have since lost my CD and product key that came with it. What is the way I can find my product key inside the registry? I tried the help section, typed in product key in the find section, but to no avail. HELP! I can get it to the point of getting it back up, but it won't let me get it started without that. Help please. Thanks much for your time and effort on my anomaly."
- Michael the "Hook"

If your Windows directory and file structure is undamaged, you should be able to access the Hidden/System/Read-Only Windows registry file that contains the original setup information. If the system still starts and you can press F8 to get the Windows startup menu, do this and choose "Command Prompt Only."

Startup Menu

If you cannot get to the Windows Startup Menu, then you will need an MSDOS boot disk (i.e. the Windows 98 Emergency Startup Disk) or the bootable Windows 98 CD. (Under Windows ME, you must use the Emergency Startup Disk and choose "Minimal Boot" since there is no Command Prompt option in the Windows Startup Menu.)

  1. Boot your computer to a DOS command prompt
  2. At the C:\ prompt, enter the REGEDIT command to export a section of the Windows System Registry to a text file. In this case, you are after data located in the HKLM\Software\Microsoft\Windows\CurrentVersion\ProductKey section of the registry. To export this group of keys to a text file, enter the following at the command prompt:
    regedit /l:c:\windows\system.dat /e c:\prodinfo.txt HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
    This command tells the REGEDIT program to open the c:\windows\system.dat registry file for input; open a new file c:\prodinfo.txt for output; and to export the section of the registry file. By default, the output will be text. If you do not specify the key, it will extract the entire (huge!) system registry, converting it to ASCII text. If you make a mistake in the key, and it cannot find the "path," it will report that the key does not exist. (Specifically: "Cannot export c:\prodinfo.txt: The specified key name does not exist.")
  3. Open the file C:\PRODINFO.TXT and search for the string "ProductKey" which should be fairly close to the top of the file.  The information you are after should immediately follow this text:
    "ProductKey"="P8ABC-DEFGM-T8HIJ-KLM29-4NO3P"

The Windows Registry is actually several files that have the hidden, system, and read-only file attributes set; they consist of user.dat and system.dat and are located in the Windows startup directory, usually c:\windows. The registry files themselves are binary files, not text, although some of the key data may be present in ASCII text format. The binary format data may prevent you from accessing the entire contents with any normal editor, in addition to the fact that the typical registry file is very large, usually at least 3-4 MB in size on a clean install of Windows. When I extracted the CurrentVersion keys to a text file, the resulting files were around 300KB in size.

dir

If you are just trying to repair the Windows installation, you can first try to reinstall Windows over the top of your existing configuration. This will retain the current system and user registry files, meaning that programs and user settings you have changed should be retained and you should not have to reinstall all your programs. On the other hand, if your system crash is caused by corruption in one of these files, you may need to do a clean install or at least remove the old registry files first. To remove the registry files:

  1. Boot from your CD or Emergency Startup disk
  2. Change to the Windows directory [CD \Windows]
  3. Clear the attributes from the registry files [ATTRIB -R -S -H *.DAT]
  4. Rename the files [REN SYSTEM.DAT SYSTEM.OLD] and [REN USER.DAT USER.OLD]
  5. Reinstall Windows by running SETUP from the Windows CD or the C:\Windows\Options\Cabs directory (if this is an OEM pre-installed system)

Chris

Get Random Access

Understanding Tech

Print this article

Shop Online

Send-to-a-
Friend

Your Name:

Your Email:

Your Friend's Name:

Your Friend's Email:


 © Micro Center