The Registry is the primary repository for system, application, and user profile configuration information for the Windows operating system. It is a hierarchical database that is structured and used much like a filesystem. The operating system uses the Registry to store information as static as environment variables and as dynamic as performance data. The Registry is constantly being used by the OS and applications to read, write, and query configuration settings.
Using a Graphical User InterfaceWindows 2000 came with two graphical Registry editors that had different benefits. The first (regedit.exe) was more user-friendly, had better search capabilities, and was easy to work with while the other (regedt32.exe) was much more powerful. In Windows XP, most of the features of these two tools were combined into a single tool. Now, Registry Editor has the same look and feel as the user-friendly version in Windows 2000 (regedit.exe), but also incorporates some important features such as permission editing from regedt32.exe. If you run either regedit.exe or regedt32.exe, you'll bring up the same tool. Using a Command-Line InterfaceThe one command-line tool we use extensively throughout this chapter is reg.exe. It comes installed by default with Windows XP. With it, you can:
Using Group PolicyYou can use Group Policy to manipulate the Registry using predefined Group Policy settings that correspond to Registry values or by creating a custom template that contains any keys and values you want to configure. See Recipe 9.3 for more information. Using Downloadable SoftwareA graphical downloadable tool you should be familiar with is Registry Monitor (regmon.exe) from Sysinternals (http://www.sysinternals.com). With it, you can view all of the Registry activity on a system in real time. You can restrict the output to a certain key, and limit the type of activity (read, write, etc.). We cover Registry Monitor in more detail in Recipe 9.11 and Recipe 9.12. To create Registry links, we use the regln tool as described in Recipe 9.10. You can download regln from the following location: http://www.ntinternals.net/regln/. Using VBScriptWMI has a single class called StdRegProv that provides most of the functions you'll need to programmatically manage the Registry. Table 9-1 contains the methods available with this class. This class is a little different from most others in that it doesn't contain properties for object instances (keys, values, etc.). To obtain information about a Registry key or value, you have to use one of the methods shown in Table 9-1.
|