Menu
Windows Registry Basics

The Registry is a database that stores information about the system, including; installed hardware and its configuration, device drivers, network settings, installed applications and their configuration, and the configuration of each user's desktop.

If you plan to maintain your own computer, you will need to become familiar with the Windows Registry. For example, if your computer stops while loading Windows and displays the mesage "Cannot find device", you will need to remove the reference to that device from the Registry.

Construction of the Registry

The Registry consists of a hierarchical structure of keys. To open the Registry Editor select Start | Run, type in regedit.exe, then click on the [OK] button. The Registry Editor is a two-pane window. "Keys" are listed in the left pane. "Values" are listed in the right pane. There are six top-level keys:

HKEY_CLASSES_ROOT File associations and software object registrations
HKEY_CURRENT_USER A pointer to the current logged in user's configuration information in HKEY_CURRENT_USER
HKEY_LOCAL_MACHINE Hardware, Software, and Security configuration
HKEY_USERS User profile for the currently logged in user
HKEY_CURRENT_CONFIG   A pointer to hardware profile that the system booted with in HKEY_LOCAL_MACHINE

Viewing the Registry

You can view and study the Registry using Registry Editor (Reged.exe). One important use of the Registry Editor is to see what programs are run every time Windows starts. Registry keys that start programs are:

HKEY_LOCAL_MACHINE
\Software\Microsoft\Windows\CurrentVersion \RunServices

HKEY_CURRENT_USER
\Software\Microsoft\Windows\CurrentVersion\Run

To open the Registry Editor, in the Start button's Search box type regedit.exe. In the Registry Editor window that appears, click the + sign in front of the HKEY_LOCAL_MACHINE key. This will open up the key and display a list of sub-keys.

Open the subkey Software. This is the key under which software vendors should install their products. In the list of Software subkeys, open the subkey Microsoft, then Windows, then CurrentVersion, then Run.

Windows Registry Editor

Note: Every key has one and only one value that is named "Default". A key may have any number of other named values, but you cannot delete the one named Default.

When you open the Run key, it will display a list of values in the right pane of Registry Editor. If you right-click on the Run key a popup menu will appear. Select New in the menu. In the New menu you will see that a keys value can have one of three different types:

Registry Data Types
REG_SZ String Value
REG_BINARY Binary Value
REG_DWORD DWORD Value
REG_QWORD QWORD Value
REG_EXPAND_SZ Expandable String Value
REG_MULTI_SZ Multi-String Value

String data. A string contains letters and numbers.
Binary data. A binary value is a number in hexadecimal (base 16) format, for example A0F7.
A DWORD (double-word) value is a four-byte value (32-bit) containing two word values, for example F09A0FA9.
A QWORD (quad-word) value is an eight-byte value (64-bit) containing eight WORD values, for example FEDCBA9876543210.
An Expandable String is a variable-length data string.
A Multi-String Value contains lists or multiple values separated by spaces, commas, or other marks.

Another important use of the Registry Editor is if your computer stops while loading Windows and displays the message "Cannot find device". For example, if every time you start your computer you receive the message: "Cannot find device dfs.vxd", you can search the registry for the entry that is calling for this file.

To search a key, right-click on the key in the left pane and select "Find..." in the popup menu. In the "Find" dialog box which appears, enter the name or value that you want to find.

If Registry Editor finds an entry, right-click on the key and select "Delete" in the popup menu. Then click on the [Yes] button in the "Confirm Delete" dialog box which appears.

There may be several entries in the registry that reference a device, so search repeatedly until you have removed all references to the value that you want to remove. Then close the Registry Editor and restart the computer.

Many times, the only option for fixing a Windows error is to work with the Registry. If you plan to maintain your own computer, you should become comfortable working with the Windows Registry.

Backing Up the Registry

Making a mistake or an incorrect change to the Registry can lead to serious problems, problems that only reinstalling the operating system can repair. It is highly recommended that you backup the Registry before any editing.

The easiest way to backup the Registry is to simply create a Restore Point before making any changes. To create a Restore Point, in Control Panel, in the System and Security section, select System section. In the left panel of the System window, click on the System Protection link to open the System Properties dialog box. In The System Properties dialog box, select the "System Protection" tab and, near the bottom of the dialog box, click on the [Create] button. You'll be prompted for a name for the new restore point.

Another way to backup the Registry is to export all of the registry to a .reg file. To export the Registry, in the Start button's Search box type regedit.exe. In the Registry Editor window that appears, select File in the menu bar, then click on Export. Select where you want to save the .reg file, then select the All option under Export range, type in a name for the .reg file, and then click on the [Save] button.

How to Modifying the Registry

There are many different methods to modify the Registry, each method has advantages and disadvantages. Using one of the methods that edits the Registry directly is the most powerful, but making a mistake this way can lead to serious problems, problems that only reinstalling the operating system can repair. The Control Panel is the safest, but also the most limited and most tedious way to edit the Registry.

Use Control Panel Utilities

Few people realize that Control Panel utilities actually edit the Registry, and the Control Panel is the safest way to edit the Registry. However, editing the Registry by some other method may be required if the key to be modified does not have a related Control Panel utility, and sometimes, rather than searching through dozens of utilities, it's easier to just edit the Registry directly.

Use the Group Policy Editor

The Group Policy Editor is a Microsoft Management Console snap-in used by System Administrators to edit the Registry in order to manage computers and users. To open the Group Policy Editor, in the Start button's Search box type mmc to open the Microsoft Management Console. In the Microsoft Management Console File menu, click Add⁄Remove Snap-in. Under Available Stand-alone Snap-ins, click Group Policy, and then click Add.

The Group Policy snap-in has braches for Computer Configuration and User Configuration. After you have installed the Group Policy Editor, you'll be able to access it by typing gpedit.msc in the Start button's Search box. Home versions of Windows do not include the Group Policy Editor, and even if you have a version that includes the Group Policy Editor, you'll need System Administrator rights to use it.

Use a Registry File

A Registry File is a file that identifies a key or keys in the registry and the values that should be assigned to that key. A Registry File also allows you to add or delete registry subkeys. A Registry File is a text file with the .reg file extension. When you double-click on the file name, Windows recognizes the file by the .reg file extension and performs the registry changes. An example of a Registry File is shown below.

Windows Registry Editor Version 5.00

[HKEY_LOCAL_ MACHINE\SOFTWARE\Policies\Microsoft\Windows\CurrentVersion\Identities]
"Locked Down"=0x00000000

A .reg file can be transported to and used on other computers. Creating and using Registry Files is for advanced users only.

Use the Windows Script Host

The Windows Script Host allows you to run Visual Basic Script files to to read, write, create and delete registry keys. A Visual Basic Script file is a text file with the .vbs file extension. When you double-click on the file name, Windows recognizes the file as a Visual Basic Script and runs the Windows Script Host to execute the file and perform the registry changes. An example of a Visual Basic Script file is shown below.

Set objShell = WScript.CreateObject("WScript.Shell")
WSHShell.RegWrite( "HKCU\MyRegKey\Entry\Value1", 3, "REG_BINARY")

A .vbs file can be transported to and used on other computers. Creating and using Visual Basic Script files is for advanced users only.

Use the Registry Editor

The Registry Editor is the official Wiindows utility for editing the registry. To open the Registry Editor, in the Start button's Search box type regedit.exe. In the Registry Editor window that appears, browse to the key you want to edit, then right-click on the key. In the popup menu that appears, select Modify. In the Edit String dialog box that appears, enter the new value for the key.

Using Registry Editor

You can use the Registry Editor to add a subkey, change a key's value, delete a subkey, or rename a subkey or a value. Editing the Registry incorrectly using Registry Editor or by any other method might lead to serious problems, problems that only reinstalling the operating system can repair.


Learn more at amazon.com

More Computer Anatomy Articles:
• VIA Chipsets
• CPU Sockets Roundup
• The RS-232 Serial Port
• How to Build Your Own PC - The Smart Way
• Laptop Computer Bottom Access Covers
• Anatomy of a Hard Drive
• How to Build a Computer
• All About Your Computer's BIOS
• General Overview Of Motherboards
• Five Types of HDMI Cables