Header Ads

test

♫ Introduction to the Registry ♫

The Registry is a database of nearly all the settings for Windows and your installed applications. The following is a brief collection of information, tips, and troubleshooting techniques involving the Windows Registry. Check out the Glossary for definitions of any of the technical terms used below.


Shameless ad: Each of the Annoyances books has an entire chapter devoted to the registry, and are considered essential guides if you want to learn more.


It is always advisable to back up your registry before making any changes to it. Note that the Registry is intended to be a little intimidating, because it is possible to screw up your entire system if you don't know what you're doing. If you back up the Registry before continuing, you eliminate this possibility.

To back up the Registry in Windows 95/98/Me, just make copies of the registry files (described below). In Windows 2000 and Windows XP, you'll need special backup software to make an effective and complete Registry backup.

Your other alternative is to use Registry Patches (see below) to back up portions of the registry before editing.


How the Registry is stored

  • In Windows 95, 98, and Me, the Registry is contained in two hidden files in your Windows directory, called USER.DAT and SYSTEM.DAT.
  • In Windows 2000 and Windows XP, the Registry is stored in several Hives, located in the \windows\system32\config and \Documents and Settings\{username} folders.



Structure of the Registry
The Registry has a hierarchal structure, like the directories on your hard disk. Each branch (denoted by a folder icon in the Registry Editor, see below) is called a Key. Each key can contain other keys, as well as Values. Each value contains the actual information stored in the Registry. There are three types of values; String, Binary, and DWORD - the use of these depends upon the context.

There are six main branches (five in Windows 2000 and Windows XP), each containing a specific portion of the information stored in the Registry. They are as follows:

  • HKEY_CLASSES_ROOT - this branch contains all of your file types as well as OLE information for all your OLE-aware applications.
  • HKEY_CURRENT_USER - this branch points to the part of HKEY_USERS appropriate for the current user.
  • HKEY_LOCAL_MACHINE - this branch contains information about all of the hardware and software installed on your computer. Since you can specify multiple hardware configurations, the current hardware configuration is specified in HKEY_CURRENT_CONFIG.
  • HKEY_USERS - this branch contains certain preferences (such as colors and control panel settings) for each of the users of the computer. In Windows 95/98/Me, the default branch here contains the currently-logged in user. In Windows 2000/XP, the default branch here contains a template to be used for newly-added users.
  • HKEY_CURRENT_CONFIG - this branch points to the part of HKEY_LOCAL_MACHINE appropriate for the current hardware configuration.
  • HKEY_DYN_DATA (Windows 95/98/Me only) - this branch points to the part of HKEY_LOCAL_MACHINE, for use with Windows' Plug-&-Play subsystem.


Using the Registry Editor
The Registry Editor (regedit.exe) is included with Windows to enable you to view and edit the contents of the Registry. When you open the Registry Editor, you'll see a window divided into two panes. The left side shows a tree with folders (see Structure of the Registry above), and the right side shows the contents (values) of the currently selected folder (key).

To expand a certain branch, click on the little plus sign [+] to the left of any folder, or just double-click on the folder. To display the contents of a key (folder), just click the desired key, and look at the values listed on the right side. You can add a new key or value by selecting New from the Edit menu. You can rename any value and almost any key with the same method used to rename files; right-click on an object and click rename, or click on it twice (slowly), or just press F2 on the keyboard. Lastly, you can delete a key or value by clicking on it, and pressing Delete on the keyboard, or by right-clicking on it, and choosing Delete.



Importing, Exporting, and Applying Registry Patches
Although you can edit the Registry with the Registry Editor (see above), you can also make changes by using Registry patches. A Registry patch is a simple text file with the .REG extension that contains one or more keys or values. If you double-click on a .REG file, the patch is applied to the registry. This is a good way to share or back up small portions of the registry for use on your own computer, or someone else's, because (among other reasons) it's much simpler and less dangerous than manually editing the Registry.

You can create a Registry patch by opening the Registry Editor, selecting a branch, and choosing Export from the File menu. Then, specify a filename, and press OK. You can then view the Registry patch file by opening it in Notepad (right-click on it and select Edit). Again, just double-click on a Registry patch file (or use Import in the Registry Editor's File menu) to apply it to the registry.



In the book In addition to covering the previous topics with substantially more depth, the Annoyances books also discuss the following:

  • What to Do With a Corrupted Registry
  • Compacting the Registry
  • Searching the Registry effectively
  • Accessing the Registry with the Windows Script Host (WSH)
  • Using the Registry Checker

No comments

please write your mail id for contact: