Editing the Registry
Updated September 1, 2002

You can tweak your Windows Registry to make some interesting, fun and sometimes powerful changes to how your PC works. But you could also mess up your computer system to the point that it won't work any longer if you incorrectly edit your Registry. This is a guide to help make sure you get only good results from your Registry editing.

What is the Registry? | Getting into the Registry
The parts of the Registry
| An example of editing the Registry
Making Registry edits take effectBacking up the Registry
Restoring the system | Searching the Registry


What is the Registry?

The Registry is like a control centre for your computer system. It consists of a suite of files where Windows stores data describing how your operating system, hardware, applications, utilities and other software function.

Every time you install some part of your system, it's recorded in the Registry along with the settings to make the new hardware or software operate with the rest of your system. Whenever you remove something, that too is noted. Often when you change the preferences, options, location or appearance of your files or folders — especially those that are essential to your system's operation — those also are tracked in the Registry.

Getting into the Registry

To get into the Registry, you can use either Windows' Registry Editor, which has been built into Windows since Windows 95, or another Registry-tweaking program downloaded from the Internet (you'll find some at serious Windows shareware/freeware sites). Although the shareware programs often offer greater capabilities, we'll assume in the following instructions that you're starting out with Windows' Registry Editor.

To launch it, click on the Start button, then Run (or if you have a Windows keyboard, hold down the Windows key and press R). Type regedit into the Open field and click OK. The Registry Editor window should then open.

The parts of the Registry

You should be presented with the two-paned Registry Editor window, something like Explorer. In teh pane on the left side are listed several folders whose names start with "HKEY", which is short for "Handle to a KEY". These are also referred to as "Hive Keys".

They include:
• HKEY_CLASSES_ROOT
HKEY_CURRENT_USER
HKEY_LOCAL_MACHINE
HKEY_USERS
HKEY_CURRENT_CONFIG
HKEY_DYN_DATA (dropped in Windows XP)

You can open each of these keys by clicking the plus sign (+) to the left of it. This displays subkeys—variables or folders which often can be opened further to display variables or more subfolders.

In the right pane you will see two or three columns of information beside icons. The first column after the icon in the right pane contains the value name, often called just the value. In Windows XP, a middle column displays the type of data. The right column contains the actual value data.

There are three main kinds of value data:

• String Value data consists of words or numbers that appears in the right pane within quotation marks.

• Binary data strangely takes the form not of binary numbers, but of hexadecimal numbers. In Windows XP this is listed as REG_BINARY data.

• DWORD data is also based on hexadecimal code but is presented in Double WORD format, like 0x00100022 (1048610). In Windows XP this is called REG_DWORD format.

Other kinds of data may also crop up but you likely won't need to edit any beyond the main three. And don't worry, you don't really have to know anything about binary or hexadecimal whatever to be able to tweak the Registry, because our Cheap Tricks will tell you exactly what valuesto type in.

To change and value, you double-click on the icon at the front of the line and a dialogue box pops up in which you can enter new data or revise existing data.

An example of editing the Registry

Let's try an example in which we don't just change an existing value, but add a new one to change (very slightly) the way your system works.

Double-click on the key  HKEY_CURRENT_USER in the left pane (or click on the plus sign beside it) to open it up. Then do the same for the Control Panel subkey. Then find the Control Panel's subkey called desktop. These steps are usually given as navigating to HKEY_CURRENT_USER\Control Panel\desktop.

Right-click on the desktop subkey and in the context menu that appears select New and String Value. A new value will appear in the right pane. Right-click on this new value in the right pane and select Rename. Give it the new name of MenuShowDelay.

Now let's give the new MenuShowDelay value some data. Double-click on MenuShowDelay to bring up the Edit String box and enter 100. Click on OK. Then close up the Registry Editor and restart your computer.

When you have Windows back, let your cursor hover over items on the Start menu with the small black triangular arrows. Notice any difference? Windows had a built-in delay of 500 milliseconds (half a second) before submenus were displayed. By adding the MenuShowDelay value in the proper place in the Registry and giving it value of 100 (milliseconds), you changed that delay to one-tenth of a second. Now your menus go flying out much quicker.

You can now go back into the Registry Editor and change the MenuShowDelay value data again, if you like, to get exactly the right amount of delay you prefer.

Making Registry edits take effect

You'll notice that to make the above Registry edit take effect you had to close the Registry and reboot the computer. This is necessary to make many Registry tweaks work, because it's during the startup that Windows checks the Registry file to get much of the updated information.

Some Registry tweaks, however, take effect as soon as you close the Registry Editor. Others require only a refreshing of the Desktop — just hit the F5 function key on your keyboard while the Desktop is active and Windows will update some of its system information.

Easy, isn't it? But if you've changed the wrong string value, you may find after the reboot or refresh that your computer no longer works or has been affected in some other way.

So the number one rule for editing the Registry is: BE CAREFUL! Don't change anything unless you know what you're doing, or you are following a reputable guide. Follow directions exactly. And the number two rule is to make sure you have your Registry backed up, so you can always go back to an earlier version if you mess things up badly. Let's go on to how you do this.

Backing up the Registry

You can save a current version of the Registry with the help of Windows' Registry Editor itself. Open the Registry Editor with the usual regedit command. Under the Registry Menu, click on Export Registry File. Save the file wherever you like. The extension .reg will be added automatically.

You can also save individual keys by highlighting them before exporting. Recent versions of Windows give you a choice in the Export Registry File dialogue box to save either All or Selected Branch.

Other ways to make backups of the Registry:

In Windows 95 the Registry information is kept in two files, System.dat and User.dat, in the Windows directory. Whenever Windows is started, it stores a copy of these Registry files as System.da0 and User.da0 (those are zeros on the end of the file names).

It wouldn't hurt, every now and then, to copy the .dat files onto a removable disk. Then, if you screw up your Registry so badly that even the usual restoration methods are hopeless, you can always just copy your backed up .dat files back onto your system and reboot.

In Windows 98 and Me the Registry information is kept in two files, System.dat and User.dat, but they are bundled together with two other older system files, System.ini and Win.ini, and the four files are compressed together into a CAB file in the Windows\Sysbckup folder. Up to five of the most recent versions of this file are kept there, numbered rb001.cab to rb005.cab from most recent to oldest.

You can use the System Info (or System Information) utility in Win98 and WinMe to make CAB backups. You'll find this utility by clicking your way through Start, Programs, Accessories and System Tools. In the System Info window, click on the Registry Checker command in the Tools menu. It will quickly inspect the Registry. Then when it asks you if you want to make a new backup, click Yes. This will delete the oldest of the five CAB files and create a new one.

In Windows XP yet another method of storing Registry data is introduced. All the information is stored in a number of files in two locations—at Windows\system32\config and at Documents and Settings\Username (the name under which you log onto the computer). The files, known as hive files, are DEFAULT, SAM, SECURITY, SOFTWARE, SYSTEM and ntuser.dat.

XP does not provide a Registry backup in the System Information utility as do Win95 and 98. However you can get a similar effect by accessing the System Restore utility (Start\All Programs\Accessories\System Tools\System Restore) and selecting Create a Restore Point. Click Next, enter a brief description (like Just before I tried changing my connection speed) and click Create.

You could also make copies of the hive files on a separate disk, as added insurance.

Restoring the system

To restore the Registry to how it was at a point at which you had earlier backed it up using the Registry Editor, you can again use Registry Editor. Under the Registry Menu, click Import Registry File and select the .reg file you had saved.

How else to restore the Registry:

In Windows 95 if you blow your Win95 Registry editing so badly that you can't get into Windows at all, you can work in DOS to replace the two .dat files with the backup copies ending in the .da0 extension that had been created automatically by Windows. If you're not familiar with DOS, you will need a more experienced friend to help you through this.

To replace the .dat files with the .da0 files, first remove the three attributes (Hidden, Read-only and System) from the .dat and .da0 files with DOS commands like attrib -r -h -s c:\ windows\system.dat for each of the files. Then rename the two .dat files to end in .bak, rename the .da0 files to end in .dat and restart the computer. Then give the Hidden, Read-only and System attributes back to the new .dat files with attrib +r +h +s c:\windows\system.dat and so on.

To restore a Windows 98 system to a previous backup, restart your computer in DOS. (If you cannot do this through the shutdown procedure Restart In DOS due to Windows malfunctioning, turn off the computer altogether. Then turn it back on and press the F8 function key repeatedly during the bootup until you are presented with the Microsoft startup menu. Select Command Prompt Only from this list and you will be launched into DOS.

In DOS in the Windows directory, enter the command scanreg at the command prompt and press Enter. In the screen that comes up, agree to check your Registry. Select the option to view your backups. A list of the CAB files (ending in .cab) will appear, letting you choose which to restore.

You can also get ScanReg to restore your Registry to its last known functional state by entering, at the DOS prompt, the command scanreg /restore.

Unlike Win95 and 98, Windows Me lets you restore the Registry in Windows itself. Click Start, Programs, Accessories, System Tools and System Information. Under the Tools menu, select System Restore. Then select the option to Restore My Computer To An Earlier Date, click on Next and follow the instructions. You'll be able to go choose by date and time among previous "checkpoints" at which the system was backed up.

In Windows XP restoring the system to any earlier point works similarly to how it does in Windows Me, except you get to the utility by clicking Start, All Programs, Accessories, System Tools and System Restore. Then select Restore My Computer To An Earlier Time, click Next and follow the more elaborate process.

Searching the Registry

It's easy to search the Registry for items that might apply to a particular aspect of Windows or your installed software that you want to change. However, it can also be time-consuming — especially if you have an older, slow computer. And it can also be misleading, since you may not be sure what the references you find in the Registry actually do, so be careful.

With the Registry Editor open, click on the File menu and on Find (or press the Ctrl and F keys simultaneously). In the Find What field, type in what you're looking for and, in the Look At section, check off whether you want to search the Keys, Values, or Data, or any combination of these. Click on Find Next and wait while it searches.

If it finds an instance, you may want to check to see if there are any further references. Under the File menu, select Find Next, or just hit the F3 key.

Here's how a search and subsequent edit of the results might be carried out:

Suppose you have uninstalled and deleted every part of a program called Megamemory Waste from your system, but your computer keeps coming up with errors indicating that references to it still exist in your Registry. (Uninstalling programs can be terribly incompetent.) And you don't know where this information might reside in the massive Registry. So, you can carry out a Registry search for "Megamemory" and chances are you'll find a key containing this phrase or a reference to it in string value data. You are probably safe to just delete it if it's a key, or just delete the value if it's in a string value.

But let's be careful. First back up the Registry. Make your deletion (by right-clicking on the key or value and selecting Delete). Reboot the computer and see if the problem is fixed. If the problem is worse, like if Windows or some other needed software won't work properly, restore the previously saved version of the Registry and try something else.

Here's another example: You want to rename the Recycle Bin but you can't remember where it said the name is hidden in the Registry. So, do a search. But this time, just search on Data, because you know it's only the assigned name (the data) you want to change. Two advantages of this: The search will be much faster than if you look under all three categories, and you will avoid any references to the Recycle Bin that might be found elsewhere and should not be touched.

Even if you find data references to the Recycle Bin, be careful that you edit the right one. Other system software or applications may make such references to it and you don't want to change their values. But backing up before any iffy Registry tweaks should prevent complete disaster.