Windows Registry

Introduction

What is the Registry?

The Registry is a database used to store settings and options for Windows 9x and NT.

It contains information and settings for all the hardware, software, users, and preferences of the PC. Whenever a user makes changes to a control panel setting, or file associations, system policies, or installed software, the changes are reflected and stored in the Registry.

Why do I need to know about this?

When setting up or fixing a PC it is often necessary to make changes to program preferences, or even those for Windows itself.  For example, a network administrator may wish to remove access to certain programs or settings.

In some cases this can be done through the program's own preferences & options controls.  However, it is often necessary to manually alter these options directly, in the Registry itself.

Where is it?

The physical files that make up the registry are stored differently depending on your version of Windows:

Under Windows 95 & 98 it is contained in two hidden files in your Windows directory, called USER.DAT and SYSTEM.DAT

For Windows Me there is an additional CLASSES.DAT file

Under Windows NT / 2000 the files are contained separately in the %SystemRoot%\System32\Config directory.

You cannot edit these files directly: you must use a tool commonly known as a registry editor to make any changes (see later).

Registry Editors

RegEdit

REGEDIT.EXE is included with most version of Windows (although you won't find it on the Start Menu).  It enables you to view, search and edit the data within the Registry.

There are several methods for starting the Registry Editor, the simplest is to click on the Start button, then select Run, and in the Open box type "regedit".

Note: on a computer network, many administrators disable or remove RegEdit to stop users from using it to bypass security settings.

RegEdt32

REDGEDT32.EXE is an alternative Registry Editor, included with Windows NT / 2000.

It includes some additional features not found in the standard version, including the ability to view and modify security permissions, and fine control over certain types of Registry entry.

Others

Other popular registry editor programs include:

Notes

It is always a good idea to backup your registry before making any major changes to it.

If you change or delete a critical setting you may find yourself having to reinstall the whole operating system.  It's much better to be safe than sorry!

Tweaking tools

TweakUI

Microsoft TweakUI for 9x and NT / 2000 is a utility that allows you fine control over a number of Windows settings.  It provides a quick-and-easy way to alter Windows settings without having to directly edit the registry.

TweakUI can be downloaded from:

http://www.microsoft.com/ntworkstation/downloads/PowerToys/Networking/NTTweakUI.asp

PowerToys for Windows XP

This is a collection of add-ons for Windows XP.  Includes the XP version of TweakUI.

http://www.microsoft.com/windowsxp/pro/downloads/powertoys.asp

Policies

Windows also allows administrators to control which features of Windows are available to users, or groups of users.

For Windows 95 the policy editor (POLEDIT) is hidden in a folder of the Windows CD (Admin\Apptools\Poledit)

For Windows 98, it's on the CD under Tools\Reskit\Netadmin\Poledit.

For 2000 & XP, the policy editors are also available from the administration tools on the Start Menu, but may be started from the Star Menu's Run commands with GPEDIT.MSC

The Structure of the Registry

The Registry has a hierarchical structure, similar to the folder structure on a disk.

Hives

Each main branch (denoted by a folder icon) is called a hive.  There are six main hives, each containing a specific portion of the information stored in the Registry:

HKEY_CLASSES_ROOT

Contains all of your file associations, Windows shortcuts, and core aspects of the Windows user interface.

HKEY_CURRENT_USER

This links to the section of HKEY_USERS appropriate for the user currently logged onto the PC and contains information such as logon names, desktop settings, and Start Menu settings.

HKEY_LOCAL_MACHINE

This contains computer-specific information about the type of hardware, software, and other preferences on a given PC.  This information is used for all users who log onto this computer.

HKEY_USERS

This contains individual preferences for each user of the computer.  Each user is represented by a Security Identifier (SID) sub-key located under the main branch.

HKEY_CURRENT_CONFIG

This links to the section of HKEY_LOCAL_MACHINE appropriate for the current hardware configuration.

HKEY_DYN_DATA

This points to part of HKEY_LOCAL_MACHINE, for use with the Plug-&-Play features of Windows.  This section is dynamic and will change as devices are added and removed from the system.

Keys and Values

Each hive contains keys, also denoted by a folder icon.

Each key can contain other keys (sometimes referred to as sub-keys), as well as values.

The values contain the actual information stored in the Registry.  This information will be stored in one of three main data types:

String

Text, used to represent human-readable text values.

(The term is used by programmers to refer to a 'string' of individual characters.)

Binary

Raw binary data.  Most hardware component information is stored as binary data, and can be displayed in an editor in hexadecimal format.

DWord

Binary data, stored in a double word (4 bytes).  This is commonly used for boolean (true or false) values, such as "0" is disabled and "1" is enabled.  Additionally many parameters for device drivers and services are this type.

Resources

The Registry Guide for Windows

An excellent guide to registry settings for all versions of Windows and many popular applications, categorised into a number of sections.

http://www.winguides.com or http://www.regedit.com

TweakXP

A website dedicated to improving and customising Windows XP.

http://www.tweakxp.com

Windows Annoyances

Lots of useful tips and tricks for customising Windows or removing unwanted features.

http://www.annoyances.org/

How to make a backup of the entire registry

A guide to saving registry information from Symantec (home of Norton software titles)

http://service1.symantec.com/SUPPORT/tsgeninfo.nsf/docid/199762382617

The Mystery Behind the Windows Registry

An in-depth guide to the registry, including tips on fixing things when the registry gets corrupted.

http://www.systweak.com/winreg/winreg.htm