The Registry Editor, as mentioned earlier, is the primary tool for viewing, modifying, and deleting data in the Registry. And as you'll see later in this chapter, it also allows you to conveniently import and export data (via Registry patches), which can be thought of as another form of data entry.
Basic data entry in Registry Editor is fairly simple. In order to type data, you must first create a value to hold it. Depending on your goal, you may also need to create a new key in which to place the value.
To create a new key or value, use Edit
To delete a key or value, select it
and click Edit
To edit a value, double-click on its
icon or name, or highlight it and use Edit
Unfortunately, automation in Registry Editor is virtually nonexistent. For example, you can't copy and paste whole keys or values like you might expect (given the familiar Explorer-like interface), but you can copy key and value
names to the clipboard by pretending you're going to rename them, and then pressing Ctrl-C to copy. Another useful tool is the Copy Key Name command on the Edit menu, which copies the full path to the selected key to the Clipboard (very handy for writing this book, for example). It doesn't copy the contents of the key, nor does it include the selected value, however.
If you want to duplicate an existing value, double-click it and select all of the data in the Edit window (see Figure 8-4).
Ctrl-C will copy the data to the clipboard. Then create a new value, being sure to match the type (string, binary, or DWORD) of the original value. Type the desired value name, double-click the new value to edit it, and then use Ctrl-V to paste the copied data into the edit window.
Duplicating values can be handy not only when using an existing value as a template for a new value, but also whenever you're going to make changes to an existing value. You can make little "inline backups" by creating a new value (whatever.bak, for instance) and pasting in the old value data before you change it. This might seem a little tedious, but it might prevent future headaches if you're about to change a complex value whose format you aren't completely sure you understand, or even if you anticipate having to roll back a value to its previous state for some reason.
Unfortunately, there's no easy way to copy a key and all of its contents in Registry Editor. If you want to copy an entire key and all its values, you'll have to do it one value at a time. It's usually much easier to export the key, edit the resulting file with a text editor, and then import the edited file. (See Section 8.6 later in this chapter.)
In addition to the Edit menu, you may find Registry Editor's context menus convenient. Right-clicking on a key in the left pane gives a context menu with Expand or Collapse, New, Find, Delete, Rename, and Copy Key Name. (Expand displays a key's subkeys. It will be grayed out if there are no subkeys to display, and it will be replaced with Collapse if said subkeys are already showing.) Right-clicking with a value selected in the right pane gives a context menu with Modify, Delete, and Rename. Right-clicking in the right pane with no value selected gives a context menu with New (to create a new string, binary, or DWORD value). Press Shift-F10 to open a context menu without having to use the mouse.