Few things can strike fear into the hearts of even seasoned veterans like the mere mention of the registry. Make a wrong move and you could experience malfunctioning of your computer, lose valuable data, and need to reformat your disk(s) and reinstall the operating system. You could lose your job, ruin your marriage, kill your neighbours, overwater your flowers, or cause a global thermonuclear war. But with a good understanding of what the registry is and a firm grasp of several helpful registry tools, you'll be well on your way to alleviating those unfounded fears. First, let's take a look at just what the registry is and what function it provides. You'll often find it considered a central repository for configuration data. Just what does this mean?
Well, I can't think of any better way to put it than by stating that it's simply a database for configuration files. The structure is hierarchical, meaning that configuration data is stored in a particular order, much like a simple outline would be structured. Furthermore, each piece of data is stored in the outline as an order pair, meaning it has an associated name and a value assigned to it. It's very much the way all of your online transactions are conducted.
You're assigned an account number (the name), and when you order, you've created a balance (the value). The registry serves dozens of innovative purposes: It keeps track of the software you install on the computer and how each program relates to the others.
The registry contains the computer's hardware configuration, which includes "plug and play" devices with their automatic configurations and legacy devices. It allows the operating system to keep multiple hardware configurations and multiple users with individual preferences. It allows programs to extend the desktop with such items as shortcut menus and property sheets. It supports remote administration via the network. Of course, there's more. But this serves as a good introduction to what the registry does.
REGISTRY FILES ON DISK (the "dats")
Windows stores the entire contents of the registry in two files: System.dat and User.dat. These are binary files that you can't view using a text editor, as you can with INI files. Windows also turns on the read-only, system, and hidden attributes of System.dat and User.dat so you won't accidentally replace, change, or delete them.
System.dat contains computer-specific configuration data, and User.dat contains user-specific data. Take a look; both files are in C:\Windows. You must show hidden and system files in order to see them. To do this from Windows Explorer, choose View, then Folder Options and then choose Show All Files on the View tab.
The location of User.dat is different on a computer that has user profiles enabled. When you enable user profiles, Windows creates a new system folder called C:\Windows\Profiles, under which you'll find a folder for each user who logs on to the machine.
Each user's profile folder contains an individual copy of User.dat (and many other files and folders). You'll still find a User.dat file in C:\Windows, which Windows uses as the default for new users. Just remember that you'll see C:\Windows\Profiles\Name for each user who logs on to that computer. Profiles enable multiple users to log on to a single computer with their own familiar settings in place (Start menu, desktop, and so on). You enable profiles using the Enable Multiusers Settings Wizard, which you access by opening Users in Control Panel. Alternatively, you can open the Passwords icon in the Control Panel and use the Passwords Properties dialog box.
Another file, Config.pol, affects the settings that you see in the registry, but it's not actually part of the registry. Unlike System.dat and User.dat, Config.pol is an optional part of the Windows configuration. Open a policy template in the System Policy editor, choose the settings that you want to enforce, save the results to Config.pol, and place this file on the network. When a user logs on to a Windows computer, the operating system applies any settings it finds in Config.pol to the user's registry. There's little a user can do to circumvent the settings you put in this file, as long as he or she logs on to the network, so it's a good way to enforce restrictions throughout the network. The following list summarizes the files that comprise the registry:
The following methods describe how Windows determines the folder from which it loads:
USER.DAT
SYSTEM.DAT
For the most part, Windows usually loads System.dat from C:\Windows. If you're using a diskless workstation, the operating system might load System.dat from the network, but this situation is extremely rare.
Two files that existed in Windows 95 are not part of Windows 98. System.da0 and User.da0 were backup copies of the Registry that Windows 95 made every time the operating system started successfully. Since Windows 98 uses Registry Checker to make backup copies in CAB files, these DA0 files are no longer necessary.
REGISTRY TERMINOLOGY The following registry terminology will come in handy:
Registry … Physically, the registry is the two files, System.dat and User.dat. Logically, the registry is the configuration data that you see in the registry editor (regedit).
Registry Editor … The program you use to edit the registry. It shows the registry as a single unit, even though Windows stores the registry in two files.
HKEY … Windows divides the registry into six sections called HKEY_Name. Programmers know that HKEY means "handle to a key." Another name for these is root key. In an outline, these six sections are the very top levels.
Key … Similar to a folder in Windows Explorer. It can contain additional folders and one or more values. Think of a key as sections within an outline.
Subkey … A child that appears under another key (the parent). This concept is similar to folders and subfolders in Windows Explorer. Subkeys are similar to subsections in an outline.
Branch … Represents a particular subkey and everything it contains. A branch can start at the very top of the registry, but it usually describes a key and all of its contents. In an outline, a branch is a section and everything that appears below it.
Value entry … An order pair with a name and a value. Value entries are analogous to files in Windows Explorer.
Default value … Every key has a default value that may or may not contain data. The default value in each key is called (Default) in the registry editor. Now that you know which files the registry contains, let's take a look at some of the tools you can use to manipulate it.
SPECIFIC ROOT REGISTRY KEYS
The registry always has some key handles open, these are the ones defined in the "winreg.h" header file. Some of these keys point to sub keys in others some don't. Here is the list of all defined open key handles:
HKEY_CLASSES_ROOT
HKEY_CURRENT_USER
HKEY_LOCAL_MACHINE
HKEY_USERS
HKEY_PERFORMANCE_DATA
HKEY_CURRENT_CONFIG
HKEY_DYN_DATA
HKEY_CLASSES_ROOT points to HKEY_LOCAL_MACHINE\Software\CLASSES\ it contains file association information and other shell data.
HKEY_CURRENT_USER points to the profile in HKEY_USERS of the user currently logged in. If no user is currently logged in, it points to the HKEY_USERS\.DEFAULT key. Therefore will settings stored in the HKEY_CURRENT_USER key only apply to the current user.
The HKEY_LOCAL_MACHINE key stores information about the current computer and global configurations.
All specific user configurations are stored in a sub key in HKEY_USERS by the name of the user. The key name .DEFAULT is used if no users are logged in.
I don't know what the HKEY_PERFORMANCE_DATA key is for, because you cannot open it, but it's properly reserved for future use.
HKEY_CURRENT_CONFIG contains information about the current configurations. This key is only defined from Windows 95 and above.
I don't know what the HKEY_DYN_DATA handle is used for. You cannot create sub keys here. This key is also only defined from Windows 95 and above.
YOUR CHOICE OF REGISTRY TOOLS
You use a variety of tools to work with the registry. Some types of tools are required, and others are just niceties. A registry editor is a must-have. You use it to change values in the registry. You can use the registry editor that comes with Windows, or you can use a third-party registry editors.
Tools of the non-required variety include customization utilities and troubleshooting tools. Customization utilities are programs that help you make changes to the registry via a well-defined user interface, which typically uses check boxes to enable or disable options. There are also dozens of other programs.
Troubleshooting tools include programs that help you fix the registry after it gets messed up. These include programs such as Easy Cleaner, Reg Clean, Reg Cleaner, Registry Checker (ScanReg), Registry Monitor (Regmon), Registry Pruner, and TweakUI.
A huge variety of Registry tools are available. The ones I've listed below, while not all-inclusive, are some of the more important ones that you'll want to include in your toolbox.
REGISTRY CHECKER (ScanReg)
Registry Checker comes with Windows 98. Finally, Microsoft ships a useful Registry program with the operating system. This program fulfills the following purposes:
The best part about Registry Checker is that it largely does its own thing. Windows 98 starts Registry Checker every time you boot the operating system. Registry Checker then backs up the Registry to CAB files (compressed archive files) that you find in C:\Windows\Sysbckup. It also scans the Registry for errors. If it finds any, Windows 98 restarts the computer in DOS mode and runs Registry Checker to restore a good backup copy of the Registry automatically or to fix those errors.
EASY CLEANER
A small program which searches Windows' registry for entries that are pointing nowhere, deleting these entries will speed your system. EasyCleaner also lets you delete all kinds of unnecessary files like temps, backups etc. You can search for duplicate files and you can view some interesting information about your disk space usage.
REG CLEAN
RegClean is a freeware utility from Microsoft that repairs a number of problems that are common to Microsoft products. This utility isn't nearly as useful as Norton WinDoctor, but it serves the needs of many users.
REG CLEANER
This analyzes Windows registry keys that are stored in the HKEY_CLASSES_ROOT key in the registry and finds keys that contain erroneous values. It then records those entries in an Undo.reg file that has the following file name (where computer is the name of the computer, yyyymmdd is the date, and hhmmss is the time): Undo computer yyyymmddhhmmss.reg. It then removes the erroneous entries from the registry.
REGISTRY EDITOR
The registry editor comes with Windows. This program enables you to make the usual types of changes; you can add and remove keys and values, change values, or export entire branches of the registry to a Reg file and then import that Reg file later.
The registry editor is powerful enough to tackle most jobs and it's relatively bug-free, but it lacks the advanced features that power users require. Some claim the biggest problem with the registry editor is that opening the registry to the same key repeatedly is inconvenient. You must navigate to that same location by opening each parent key and click, click, click, until you finally reach the target.
Other registry editors, such as Norton Registry Editor, solve this problem by enabling you to bookmark keys and then return to them by choosing the name from a menu. Other features that are missing include the capability to undo changes you make, to search and replace values, to make shortcuts to branches within the registry, and to back up the registry from within the editor. The Norton Registry Editor includes all of these capabilities.
REGISTRY MONITOR
Registry Monitor (also called "RegMon") enables you to watch what's going on in the registry in real time. In other words, you can observe changes to the registry as they occur is a program that you can use to monitor changes to the registry as they occur. It gives you insight into how the operating system and other programs use the registry. You can monitor Windows Explorer's registry access as you open the Folder Options dialog box to see where the program stores each option in the registry. If you're curious about the changes that a setup program makes to the registry, monitor the setup program and filter Registry Monitor's output so that it displays only changes.
REGISTRY PRUNER
Cleans up the registry's SharedDLLs key. Orphaned entries can cause install and uninstall programs to misbehave, and can even trigger bogus "Registry Corrupted" error messages. The program can also removed "ghosts", entries in the Control Panel's Add/Remove Programs list that remain even after a program has been uninstalled. It also corrects the explanation of the Add/Remove tab that appears in the program's main window at startup.
TWEAK UI
The one customization utility you need to install is Microsoft Tweak UI. Microsoft developers built this tool to help users run the most popular customizations without actually having to edit the Registry. This program didn't come with Windows 95; instead, you had to download it from the Internet. Now, however, it is included with Windows 98.
OTHER FILES AND PROGRAMS
Three important types of files you need to add to your arsenal aren't programs; they're scripts, INF files, and REG files.
Windows 98 includes the Windows Scripting Host, an interpreter that understands JavaScript and Visual Basic Scripting Edition (VBScript) script files and allows those scripts to access the object model exposed by the Windows operating system. Internet Explorer 4 (or later) adds the Windows Scripting Host to Windows 95.
INF and REG files are very similar, they enable you to script changes to the Registry. You can use INF files to add, remove, and change values. The notation is simple and easy to write. REG files enable you only to add and change values, not remove them. They're also not as clean to write as INF files, but you can easily create them by exporting branches from within the Registry Editor.
All three types of files have the benefit of being easy to distribute via the network. You can post them to a Web site and enable users to launch them. You can e-mail them to a user for the same purpose. You can also put them in the user's login script so that the operating system automatically launches them.
If you read almost any article in the Microsoft Knowledge Base that suggests editing the Windows registry, you will see this:
WARNING: Using Registry Editor incorrectly can cause serious problems that may require you to reinstall your operating system. Microsoft cannot guarantee that problems resulting from the incorrect use of Registry Editor can be solved. Use Registry Editor at your own risk.
That often stops new users from reading any further. The Windows registry is a subject to which entire websites are devoted, so I won't be giving too much detail of its workings here. This page is simply to teach you the very basics you need to know in order to edit the registry manually. The only tools you need are already on your computer: Regedit, the registry editor built into Windows, and Notepad.
Backup and Restore the Registry
Before proceeding, you must know how to backup and restore the registry. Click Start, Run, and type "regedit" (without the quotes), then click OK. Now click Help, Help Topics. The choices you see differ slightly depending on which version of Windows you have. If you have Windows95, you must backup the registry manually, as explained in the Help file. Windows98 automatically saves backup copies of the last 5 working registries. All versions of Regedit Help contain instructions for restoring a registry. You should print those instructions now for you won't be able to access them if Windows cannot start. You will also see help topics for editing values and keys. I strongly urge you to read the entire Help file, which is quite short, before you start experimenting. Backup and Restore a Registry Key Using Regedit, it is very easy to backup and restore any key in the registry to a text file with the extension *.reg. Such registry files can be edited in Notepad if necessary. Before making any change in Regedit, you should be sure to export the key you are about to change. If the change you made causes unexpected problems, you can easily restore the previous key.
TO SUMMARIZE
The Windows registry stores hardware and software configuration information. It tells Windows what hardware is installed in your PC, what settings should be used when starting applications, and controls many other system-level functions. You can type "regedit" (sans quotes) in the Run menu and make all kinds of changes to your system. Anytime you install a new application, configuration data is added to the registry. When you remove programs, the registry is also changed. Now that you have a better idea of what the registry does, tread lightly through this territory, and avoid leaving footprints on your way out.
CONCLUSION
So there you have it. You've been given a brief overview of the Windows Registry, what its function is and what files the Registry contains. And you've been given some important tools to include in your troubleshooting arsenal. With a little more understanding of the files included in your registry, you'll be well on your way to solving any Windows Registry problems that may occur on your own system or on network clients.
This way is back to ... Tips 'n Tricks Menu ... next line for exit.
Here we'll return to ... Navigator ... that's bon voyage.
Found something worthwhile? Why not drop a line and let me know?