Windows Server 2012 provides several tools for working with the
registry. The main tool, of course, is Registry Editor,
which you start by typing regedit or
regedt32 at the command line or in the
Run dialog box. Another tool for working with the registry is the
REG command. Both tools can be used to view and manage
the registry. Keep in mind that although both tools are considered
editors, Windows Server 2012 applies any changes you make immediately. Thus, any change you make
is applied automatically to the registry without you having to save
the change.
Caution
As an administrator, you have permission to make changes to
most areas of the registry. This allows you to make additions,
changes, and deletions as necessary. However, before you do this,
you should always make a backup of the system state along with the
registry first.This helps ensure that you can
recover the registry in case something goes wrong when you are
making your modifications.
One of the common tasks you’ll want to perform in Registry
Editor is to search for a particular key. You can search for keys,
values, and data entries using the Find option on the Edit
menu.
Don’t let the simplicity of the Find dialog box, shown in
Figure 5, fool you—there is a
bit more to searching the registry than you might think. So, if you
want to find what you’re looking for, do the following:
-
The Find function in Registry Editor searches from the
current node forward to the last value in the final root key
branch. So, if you want to search the complete registry, you
must select the Computer node in the left pane before you select
Find on the Edit menu or press Ctrl+F. -
Type the text you want to find in the Find What box. You
can search only for standard American Standard Code for
Information Interchange (ASCII) text. So, if you’re searching
for data entries, Registry Editor searches only string values
(REG_SZ, REG_EXPAND_SZ, and REG_MULTI_SZ) for the specified
text. -
Use the Look At options to control where Registry Editor looks for the text you want to
find. You can search on key names, value names, and text within
data entries. If you want to match only whole strings instead of
searching for text within longer strings, select
the Match Whole String Only check box.
After you make your selections, tap or click Find Next to
begin the search. If Registry Editor finds a match before reaching
the end of the registry, it selects and displays the matching item.
If the match isn’t what you’re looking for, press F3 to search again
from the current position in the registry.
When you want to work with keys and values in the registry,
you typically are working with subkeys of a particular key. This
allows you to add a subkey and define its values and to remove
subkeys and their values. You cannot, however, add or remove root
keys or insert keys at the root node of the registry. Default
security settings within some subkeys might also prohibit you from
working with their keys and values. For example, by default you
cannot create, modify, or remove keys or values within HKLM\SAM and
HKLM\SECURITY.
The most common change you’ll make to the registry is to
modify an existing value. For example, a Knowledge Base article
might recommend that you change a value from 0 to 1 to enable a
certain feature in Windows Server 2012 or from 1 to 0 to disable
it. To change a value, locate the value in Registry Editor, and
then in the right pane double-tap or double-click the value name.
This opens an Edit dialog box, the style of which depends on the
type of data you are modifying.
The most common values you’ll modify are REG_SZ,
REG_MULTI_SZ, and REG_DWORD. Figure 6 shows the Edit
String dialog box, which is displayed when you modify REG_SZ
values. In the dialog box, you typically replace the existing
value shown in the Value Data box with the value you need to
enter.
Figure 7
shows the Edit Multi-String dialog box, which is displayed when
you modify REG_MULTI_SZ values. In this example, there are three
separate string values. In the dialog box, each value is
separated by a new line to make the values easier to work with. If
directed to change a value, you typically need to replace an
existing value, making sure you don’t accidentally modify the
entry before or after the entry you are working with. If directed
to add a value, you begin typing on a new line following the last
value.
Figure 8
shows the Edit DWORD Value dialog box, which is displayed when you
modify REG_DWORD values. In this example, the value is displayed
in hexadecimal format. Typically, you won’t need to worry about
the data format. You simply enter a new value as you’ve been
directed. For example, if the Current value entry represents a
flag, the data entry of 1 indicates the flag is on (or true). To
turn off the flag (switch it to false), you replace the 1 with a
0.
Note
The Windows Clipboard is available when you are
working with Registry Editor. This means you can use the Copy,
Cut, and Paste commands just as you do with other Windows programs. If there is a value in a
Knowledge Base article that’s difficult to type, you might want
to copy it to the Clipboard and then paste it into the Value
Data box of the Edit dialog box.
As noted previously, you can add or remove keys in most
areas of the registry. The exceptions pertain to the root node,
root keys, and areas of the registry where permissions prohibit
modifications.
You add new keys as subkeys of a selected key. Access the
key with which you want to work, and then add the subkey by
pressing and holding or right-clicking the key and selecting Edit,
New, and then Key. Registry Editor creates a new key and selects
its name so that you can set it as appropriate. The default name
is New Key #1.
The new key has a default value entry associated with it
automatically. The data type for this default value is REG_SZ.
Just about every key in the registry has a similarly named and
typed value entry, so don’t delete this value entry. Either set
its value by double-tapping or double-clicking it to display the
Edit String dialog box, or create additional value entries under
the selected key.
To create additional value entries under a key, press and
hold or right-click the key, and then select New followed by one
of these menu options:
-
String Value Used to
enter a fixed-length string of Unicode characters. The type is
REG_SZ. -
Binary Value Used to
enter raw binary data without any formatting or parsing. The
type is REG_BINARY. -
DWORD (32-bit) Value Used
to enter binary data type in which 4-byte integer values are stored. The type is REG_DWORD. -
QWORD (64-bit) Value Used
to enter binary data type in which 8-byte integer values are stored. The type is REG_QWORD. -
Multi-String Value Used
to enter a multiple-parameter string. The type is
REG_MULTI_SZ. -
Expandable String Value
Used to enter a variable-length string that can include
environment variables that are to be expanded when the data is
read. The type is REG_EXPAND_SZ.
Creating a new value adds it to the selected key and gives
it a default name of New Value #1, New Value #2, and so on. The
name of the value is selected for editing so that you can change
it immediately. After you change the value name, double-tap or
double-click the value name to edit the value data.
Removing keys and values from the registry is easy but should never be done without
careful forethought to the possible consequences. That said, you
delete a key or value by selecting it and then pressing the Delete
key. Registry Editor will ask you to confirm the
deletion. After you do this, the key or value is permanently
removed from the registry. Keep in mind that when you remove a
key, Registry Editor removes all subkeys and values associated
with the key.
|