[ABC home]    [ABC Archives by Issue]   [ABC Archives by Author]  [Search]  [Privacy]


ABC Home Page
ABC Home


Advertise in ABC


Learn more
Vic Ferri

Vic Ferri

Vic's Archives

Vic's Archives


Subscribe to
WinTips&Tricks Email Support Group and Newsletter

Subscribe to
Registry Answers
Registry Answers Newsletter

PowerPoint to Exe
convert PowerPoint presentations to exes

Lock 'n Hide
Folder Security

Hide files and folders in Windows 9X

Free Demo

Great prices on computer magazines

Learn the Registry in plain English

 Mr. Ink Man - Great prices on ink cartridges




ABC ~ All 'Bout Computers
The Online Web-azine for Computer Enthusiasts
-- brought to you by
Visit Linda's Computer Stop

contents page for this issue


 Support ABC


Linda's Ebooks
Ebooks on Access, Excel, Outlook, PowerPoint, Publisher, and Word

Linda's CD
Order Linda's CD and learn all of the Office programs

The Newbie Club
Learn all about computers the easy way

Online classes
at Eclectic Academy
 Instructor led online courses at Eclectic Academy

My Newest Book
Excel 2003 Study Guide

published by Wiley
get it at Amazon,
at Barnes & Noble,
or at Borders

& Screen Capture

Great FrontPage addins and other software


great Windows utilities



Vic's Registry RoundUp and DOS Den
~~Vic Ferri, Win Tips and Tricks

something else from Vic Ferri....
Lock&Hide High level desktop folder security for Windows 95/98/Me.  Keep your personal and most valuable files locked and hidden from prying eyes, viruses, and other users of your computer.  Easy to use and extremely secure.
Download the free demo here.

Retrieving a Lost Windows Install Key

Here's the situation: you want or need to reinstall Windows, but you discover that you have lost your Windows install key.

Note the word "reinstall". This is about retrieving your own serial from an existing Windows 95,98, 98se, 2000, or XP installation, which may or may not be corrupt. This is not about getting a cracked serial.

So what to do? Well, it depends on your operating system and the condition it is in, but regardless, you will see, that in all cases, it is quite a simple matter to recover your lost key, even if your only access to your system is with a boot disk to DOS.

Windows 9X (click here to download a ready made file that will find your Win9x/ME key)

The first thing to know is that in Windows 9x only, your Windows key is viewable in the Registry and stored in the file system.dat. Regedit.exe makes it possible to view your registry in an organized and legible format, but you should understand that regedit is not your actual registry. Regedit, as the name implies, is just a convenient editor that allows you to view and edit system.dat and user.dat which are the files that make up your real registry. Windows 2000 and XP do not use the registry or any registry related file to store your Windows key.

You should also know that, unless you're using Windows 95, Product Key and Product ID are not the same. The Product Key is a 25 alphanumeric code grouped in five sections of five characters each, ie: CJ321-TJ9N6-JVB2R-50BQP, and is the one needed to install Windows 98 and Me. The Product ID is produced when you install Windows.

You don't need to enter the Registry to see your Product ID. You can see it under the general tab of System Properties (right click My Computer and choose Properties to see it).  You cannot install Windows with the Product ID in Windows 98 and up.  Only in Windows 95 can you do this. In Windows 95, your install key is the same as the Product ID you see in System Properties , which is the same Product ID you see in the Registry. The Windows 95 ProductID is made of 20 characters, in four groups consisting of 5, 3, 7, and 5 characters. The 3 character set will be the letters OEM if you have an OEM system. ie: 12345-OEM-1234567-12345.

To find your Windows key using regedit:

Click Start>Run and type regedit. Click OK and make your way down to this key:


If you are using Windows 98/Me, look in the right hand pane for the value ProductKey. If you are using Windows 95, you would look for ProductID, instead, as was already explained. 

And there you have it.

Though that was simple, an even easier method of getting your Product Key is by having a pre-created bat file that will retrieve it for you with just a double click. No need to enter that scary registry at all.  Try this demo to see for yourself how it works. (click here to download the premade bat file)

NOTE: Because of word wrap the files below may not show correctly.  Make sure the line beginning with "start.." and the line beginning with "HKEY.." are just one long line.

(ie: start /w regedit /e key.txt HKEY_LOCAL_MACHINE\SOFTWARE\
Microsoft\Win... )

@echo off
start /w regedit /e key.txt HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion
type key.txt|find "ProductKey"
del key.txt

If you never made a batch file before, copy and paste the above commands into a Notepad document (with Word Wrap turned OFF) and save the file with a .bat extension, ie: key.bat

To use, simply double click and in an instant you will see your Product Key displayed on the screen.  The file can also be easily run in Windows Dos mode (not native dos mode) if you can't access it in Windows. Place the file in your Windows folder and then all you have to do is enter the name of the file at the WIndows prompt, ie: C:\WINDOWS\>KEY  No need to enter the bat extension.

You can vary the bat file to produce for you a text document with your Product key in it. ie:

@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

Double clicking the above file will create a text document named mykey.txt with your Windows key in it. The file will be created in whatever directory you run the bat file from.

So, as you can see it appears to be quite a simple matter to recover a lost Product Key.

But what if you are in a situation where you're having computer problems and need to reinstall Windows, and though you can access Windows, you can't access the registry to find the Product Key and the above bat files don't work? Well, nothing to worry about. It's just as easy - if not easier - to find your key. All you have to do is open up System.dat with a text editor (Notepad isn't big enough to hold System dat, but Wordpad is) and doing a search for the word ProductKey (or ProductID if you're using Windows 95).  You'll be surprised by how fast you find it. First try should get you there. By the way, you will find system.dat in your Windows folders, but make sure you have Show All Files enabled.

Now, a more serious situation. You can't access Windows 9x at all, not even safe mode. Your only access is through native dos and a Windows startup disk. Again, nothing to worry about. Here's two ways you can use to retrieve your lost key, a manual way and an automated way.

The manual way:
Boot up your computer with your startup disk, without cdrom support. When you get to the A:\> prompt, type the following commands, pressing Enter after each.


Again, if it's Windows 95, substitute PRODUCTID for PRODUCTKEY.

This will search system.dat for the word entered and output the results on the screen for you. Your Windows key will be right there in front of you.
Write it down on a piece of paper and you'll be all set to begin your Windows reinstall.

The auto way:  Via a batch file, of course.
If you prepare this in advance, it will make it even easier to retrieve your key in such a situation. Make a batch file with the following command lines:

@echo off
find "ProductKey" c:\windows\system.dat

or, if you're using 95,

@echo off
find "ProductID" c:\windows\system.dat

Save it as key.bat and place it on your bootup disk.
This will now allow you to find your Windows key by just typing KEY at the A:> prompt. You may also want to place a copy in your c: drive. This would be handy if you boot to your c: drive in native dos mode, without your startup disk.

And that's about as difficult as it gets to recover your ProductKey or ProductID, in a situation where Windows is already installed on your computer.

Now a bit about pidgen.dll in Windows 9x, to help you understand how ProductID and ProductKey are related.
Pidgen.dll, as the name implies, is the file that GENerates your PID (ProductID) When you install Windows 9x, Windows looks for this dll which is located in Precopy1.cab. Pidgen.dll then creates for you a unique ProductID based on the valid ProductKey you entered. If there is no valid key entered, it can't produce a PID, and thus you cannot continue installing.

In a desperate situation, where one has a Windows 98 CD with no key or identity at all, it could be possible to debug pidgen.dll so that Windows could be installed with any characters you want, except all 0's.
You would have to copy your Windows cd to your hard drive, extract pidgen.dll from precopy1.cab, and then debug it from the dos prompt. ie:

debug pidgen.dll
-e 1ed7
xxxx:1ED7 39. 8b
-e 1edf
xxxx:1EDF 39. 8b

A hex editor can do the job too.

However, this doesn't work on all versions or releases of Windows and you should be aware that debugging a Windows file is considered illegal and doing so would void any warranty.

Windows 2000 and XP

(NOTE: If you have problems with these methods, you can download utilities here that will find your 2k or XP key for you automatically.)

If you have permission or Administrator status, in Windows 2000 and XP, retrieving your key may be a simple matter of opening up the file $WINNT$.INF. in your Windows\System32 folder. This file is used for unattended or automated installs of Windows NT/2000/XP and you will find your Windows key under the section [User Data] which should be right at the top. Your key can be named ProductKey or ProductID (in my 2k install, the key is listed as ProductID)

If you can't access Windows, you can retrieve your own key via the command line or using a Windows 9x boot disk, if the partition is FAT.

At the prompt you would type:

If you're accessing from a Windows 9x disk, run the command from the 9x C: prompt with the MORE switch added.


This will display the info one page at a time. Windows XP doesn't include the More command, so that's why you should run it from the Win9x command prompt.

An alternative is to copy the file to a floppy disk.

However, if you have an attended install of the Corporate version of XP, you will have to use a little proggie that you can download here to reveal your key automatically.

It should go without saying, that in XP, the key will only allow you to install, not activate, unless you are using the Corporate version which requires no activation.

Vic Ferri owns the very popular WinTips and Tricks and Registry Answers. Subscribe to either and receive free Windows and Registry Tips. He is also in charge of the Printing Tips pages at Linda's Computer Stop. Vic has also created a program which allows you to Lock & Hide desktop folders in Windows 9X/ME. Read more and get the free demo here. And, he now offers a service to convert PowerPoint presentations to .exe files which can be viewed on computers which do not have PowerPoint installed.

Privacy Policy, Disclaimer, and Legal Stuff

Pay Per Click Ads by Pay Per Click Advertising by Kontera

This page was last updated on Tuesday, September 23, 2008 . copyright 2000 - 2008, Linda F. Johnson, Linda's Computer Stop, ABC ~ All 'Bout Computers. All rights reserved.