Windows Registry

Dennis Faas's picture

In computing, the Windows registry is a database which stores settings and options for the operating system for Microsoft Windows 32-bit versions. It contains information and settings for all the hardware, software, users, and preferences of the PC. Whenever a user makes changes to "Control Panel" settings, or file associations, system policies, or installed software, the changes are reflected and stored in the registry.

As time goes on, an aged Windows installation can have a very large registry database. This can slow down the computer's startup and has led to frequent criticisms that the registry leads to instability (refer to this Gazette article for more info).

Windows Registry: Structure

The Registry is split into a number of logical sections. These are generally known by the names of the definitions used to access them in the Windows API, which all begin "HKEY" (an abbreviation for "Handle to a Key"), and are often abbreviated to a 4 letter short name.

  • HKEY_CLASSES_ROOT (HKCR) stores information about registered applications, including associations from file extensions and OLE object class ids to the applications used to handle these items.  
  • HKEY_CURRENT_USER (HKCU) stores settings that are specific to the currently logged in user.   
  • HKEY_LOCAL_MACHINE (HKLM) stores settings that are general for all users on the computer.  
  • HKEY_USERS contains subkeys corresponding to the HKEY_CURRENT_USER keys for each user registered on the machine.  
  • HKEY_CURRENT_CONFIG contains information gathered at runtime; information stored in this key is not permanently stored on disk, but rather regenerated at boot time. 

Each of these keys is divided into subkeys, which may contain further subkeys, and so on. Any key may contain values, which are either strings, "DWords" (numbers between 0 and roughly 4 thousand million), lists of strings, or binary data. Each key has a default value, which is in effect a value with the same name as the key.

Windows Registry: Editing

The registry can be edited in Microsoft Windows by running regedit.exe in the Windows directory. However, careless registry editing can cause irreversible damage. Many optimization and "hacking" tools are available to modify this portion of the Windows operating system. It is preferable to use one of the many registry cleaners available, such as Registry Mechanic.

Windows Registry: Criticisms of the Registry Concept

The Windows Registry was introduced to tidy up the profusion of INI files that had previously been used to store configuration settings for Windows programs. These files tended to be scattered all over the system, which made them difficult to keep track of. However, the centralized Registry introduces its own problems: it is a single point of failure, in that damage to the Registry can render a Windows system unbootable, in extreme cases to a point that can only be fixed by a hard drive format and system reinstall.

Also, any program which wants to manipulate the registry must use special Windows API functions, whereas a configuration file can be manipulated using normal file-processing techniques. This also applies to hand-editing - to edit the Registry, a special program like Regedit must be used; configuration files can usually be edited using an ordinary text editor.

Other systems preserve the concept of separate configuration files for separate application subsystems, but group them together in a single filesystem directory for ease of management, such as the Preferences Folder in Mac OS, or the /etc directory in Unix and Linux systems. Thus, fine-grained access to configuration settings can be controlled by normal filesystem protection mechanisms.

This article is adapted from: wikiPedia.com

Rate this article: 
No votes yet