Xem mẫu

  1. Examining the Regedit User Interface This section can be used as a brief reference when working with Regedit. It provides a description of all the functions of the registry editor. The following sections contain instructions and tips on using Regedit, as well as directions for modifying the registry. The Registry Editor window contains four main regions (Fig. 3.1): The menu bar. The menu bar contains the following menu items: Registry, Edit, View, Favorites (this menu item was first introduced with Windows 2000), and Help. Left pane. The left pane displays the registry hierarchy organized in keys and subkeys. Right pane. The right pane displays value entries contained within a selected registry key. Each value entry is identified by its name, which is displayed in the Name column; data type, which is displayed in the Type column (a small icon to the left of the name helps to identify the data type); and the value, which is displayed in the Data column. Status bar. The status bar indicates the path to the selected registry entry. It is helpful when you need to view the full path to the registry key containing the selected registry entry. Figure 3.1: The Registry Editor window When you start Regedit, the Registry Editor window displays only the top-level registry keys below the My Computer icon. These are the root keys described in Chapter 1. If you click [+] to the left of the folder, this will expand the respective registry key displaying its subkey hierarchical structure. This operation expands the key tree to the next nesting level and resembles similar methods of opening folders in Windows Explorer. If the subkeys contain other nested keys, they'll also have the [+] sign to the left of the folder. The subkeys, in turn, can also be expanded to view the next level of the registry
  2. hierarchy. This method of organizing the registry information is known as nesting. Any number of nesting levels is possible. This hierarchical organization is the main difference between the registry and the initialization files. It provides a significant advantage over the methods for storing the initialization information used in Windows 3.x. When you reach the lowest level of nesting, the [−] sign will appear to the left of the folder icon. This means that the key can't be expanded further and you can only go back up the hierarchical tree. If neither the [+] nor [−] icons are present, this means that the key doesn't contain any subkeys. Table 3.1 provides a list of keyboard shortcuts used for viewing and navigating the registry using Regedit.exe. Table 3.1: Keyboard Shortcuts Used in Regedit.exe Key Description Expands the selected registry key by one level to show its subkeys Collapses the selected registry key by one level Moves you up to the next key Moves you down to the next key Expands the selected key by one level to show subkeys; if there are no subkeys, moves you down to the next key Collapses the selected key if it was open; otherwise, moves you up to the next key Moves you to the next pane of the Registry Editor window Registry value entries are displayed in the right pane of the Registry Editor window. Each value entry contains three parts: name, data type, and value data. Like any parameter, each registry value entry has a name. Many value entries provided by Microsoft use a "Default" name (as you'll see later when you begin intense work with Regedit). All of the names of the value entries are displayed in the Name column in the right pane of the Registry Editor window. These names are assigned to the value entries by the software and hardware developers. Data types that describe the registry value entries are displayed in the Type column. Definitions of all of the registry data types defined and used in Windows NT/2000/XP as well as in Windows Server 2003 are provided in Chapter 1.
  3. For the sake of convenience, the Regedit.exe utility uses special icons, which are displayed to the left of the value names. These icons allow the user to quickly distinguish between binary and text data. A brief description of the icons displayed in the Registry Editor window is provided in Table 3.2. Table 3.2: Icons Used for Designating Registry Data Types in Regedit.exe Data Description type Designates binary data (including REG_BINARY, REG_DWORD, REG_RESOURCE_LIST, REG_FULL_RESOURCE_DESCRIPTOR, and REG_RESOURCE_REQUIREMENTS_LIST) Designates text data and readable characters. For example: "On The Microsoft Network" (string data types, such as REG_EXPAND_SZ, REG_MULTI_SZ, and REG_SZ) The Data column contains text or binary data that correspond to the value of the selected registry entry. You can edit, create, or delete this data to optimize software functionality or troubleshoot. A brief description of the Registry Editor menu items is shown below. The File Menu Commands The File menu contains the following commands: Import… Export… Load Hive… Unload Hive… Connect Network Registry… Disconnect Network Registry… Print… Exit The Import… command allows you to import previously exported registry files in ASCII or REG format. The Export… command exports either the whole registry, or only a part of it, as a REG file or an ASCII file. To export the registry branch, proceed as follows:
  4. 1. Select the registry branch you wish to export. Then select the Export… command from the File menu. 2. The Export Registry File window (Fig. 3.2) will open. Enter the file name in the File name field. By default, this file will be given the REG filename extension. If you need to save the exported file in another format, select the option you need from the Save as type list below the File name field. Despite all of the apparent similarities between the Regedit.exe versions supplied with Windows 9x, Windows NT 4.0/Windows 2000, Windows XP, and Windows Server 2003, these are different versions of the same application. The Regedit.exe version included in Windows XP and Windows Server 2003 allows you to save exported registry files in various formats, including both the newer format used in Windows 2000/XP and Windows Server 2003 (use the Registration files (*.reg) option for this purpose) and the registry file format used by Windows 9x and Windows NT 4.0 (use the Win9x/NT 4 Registration files (*.reg) option for this purpose). Furthermore, now you can save the exported registry file as a hive (select the Registry Hive Files option) and in text format (use the Text Files (*.txt) option) Figure 3.2: The Export Registry File window 3. If you need to export only the branch that you have selected previously, set the Selected branch radio button in the Export range option group. However, if you frequently modify the system registry, exporting the whole registry would be better. Exported registry files will provide you with additional options if you need to troubleshoot a damaged system. 4. Click the Save button.
  5. You can view the saved file using any text editor to make sure that everything was saved correctly. Exported registry files contain unformatted ASCII text. Be very careful when working with exported registry files, especially when you export registry files for experimental purposes. For example, experienced administrators can solve problems by editing the exported registry file, and then importing this file back into the system. However, before you start introducing changes, take all necessary precautions: 1. Create a backup copy of the exported registry file that you need to edit. If you make an error during the editing session, you can correct the problem by importing the backup copy of the REG file. 2. If you're going to experiment with the registries of various operating systems (including Windows 9x/ME, Windows NT/2000, Windows XP and Windows Server 2003), store the exported registry files for each operating system in folders dedicated specifically to this purpose. This will help you avoid problems caused by importing incompatible registry files. 3. By default, REG files are associated with the Regedit.exe application (Fig. 3.3). The Regedit.exe application merges these files into the registry (Merge is the operation performed by default). In contrast to its predecessors, Regedit.exe versions supplied with Windows XP and Windows Server 2003 prompt you to confirm if you really want to add the contents of an exported file to the registry (Fig. 3.4). Be very careful at this stage, in order to avoid accidentally importing incompatible or incorrect registry settings.
  6. Figure 3.3: By default, REG files are associated with the Regedit.exe application Figure 3.4: Registry Editor prompts you to confirm that you really want to add the contents of the exported REG file to the registry