Editing Values in the Registry

Each value entry in Registry Editor appears as a string that consists of three components, as shown in the following figure.

Figure 11.1 The Three Components of a Value Entry

The following rules govern the content of these three value entry components:

The Registry preserves case as you type it for any entry but ignores case in evaluating the data. The names are case-insensitive. However, the data is defined by specific applications (or users), so it might be case-sensitive, depending on how the program that uses it treats the data.

To edit any value

  1. In the right pane of the Registry Editor window, double-click the value entry.

    – Or –

    From the Edit menu, choose the String, Binary, DWord, or Multi String command as appropriate for the selected value.

  2. Edit the value that appears in the related Editor dialog box, and then choose the OK button.

    The Binary and DWord editors give you the flexibility to select the base of a number system in which you want to edit your data. In the Binary editor, you can edit your data as binary (base 2) or hex (base 16). In the DWord editor, you can edit your data in binary, hex, or decimal (base 10). Hex is the default base for both editors. These types of data will always be displayed in hex in the right pane of the Registry Editor.

Tip To view numbers in decimal format, double-click the value entry and select the Decimal format option. Cancel the dialog box when you finish checking the value.

Information stored in a nonvolatile key remains in the Registry until you delete it. Information stored in a volatile key is discarded when you shut down the system. Everything under a volatile key is also volatile. Everything stored under the HKEY_LOCAL_MACHINE\HARDWARE key is volatile.

Note If your Registry becomes quite large, you will want to set a larger value for the value entry named RegistrySizeLimit, as described in "The CurrentControlSet\Control Subkeys" in Chapter 14, "Registry Value Entries."

Adding a Key

You can add a key to store data in the Registry. For example, you might add a subkey under CurrentControlSet\Services to start a service process you have written or to install a device driver that doesn't have an installation program.

To do this, you must have Create Subkey access permission for the key under which you are adding a subkey, as described in "Assigning Access Rights to Registry Keys," later in this chapter.

To add a key to the Registry

  1. Select the key or subkey under which you want the new key to appear, and then choose the Add Key command from the Edit menu, or press the INS key.
  2. In the Key Name box of the Add Key dialog box, type the name that you want to assign your key.

    The key name cannot contain a backslash (\), and it must be unique in relation to other subkeys at the same level in the hierarchy. That is, Key1 and Key2 can each have a subkey named Key3, but Key1 cannot have two subkeys named Key3.

  3. Leave the Class box blank, as this entry is reserved for future uses.
  4. Choose the OK button to display the new key in the Registry Editor window.

Adding a Value Entry to a Registry Key

In Registry Editor, you can assign a new value entry to a key or edit the value entry of an existing key. When you do this, the value that you add appears in the data pane of the selected Registry window.

You may want to add value entries based on tuning and troubleshooting information you find in Chapter 14, "Registry Value Entries".

To add a value entry to a Registry key

  1. Select the subkey to which you want to add a value entry.
  2. From the Edit menu, choose the Add Value command.

    The Value Name box is displayed.

    Tip To quickly open the Value Name box, move the focus to the right pane using the TAB key or the mouse, and then press the INS key.

  3. In the Value Name box, type the name you want to assign to the new value entry.
  4. In the Data Type box, select the type that you want to assign to the value entry, as described in Table 10.2 in Chapter 10, "Overview of the Windows NT Registry."
  5. Choose the OK button, and then type the value in the Editor dialog box that appears. Choose the OK button again to display the new entry in the Registry Editor window.

Deleting a Key or a Value Entry

You can use either the Delete command from the Edit menu or press the DELETE key to remove selected keys or value entries from the Registry. However, you cannot delete any of the predefined subtrees or change the name of a key.

Caution

There is no Undo command for deletions. Registry Editor asks you to confirm the deletions if the Confirm On Delete option is checked under the Options menu. However, the message does not include the name of the key you are deleting. Check your selection carefully before proceeding when you delete a key.

The only way to retrieve a key that you mistakenly delete is to restart the computer. Press the spacebar immediately after selecting Windows NT at the Boot Loader prompt, and then choose the Last Known Good option to roll back to an earlier configuration.

You can protect the Registry from accidental deletions in these ways: