| Windows Registry |
Article Index for Windows |
Website Links For Windows |
Information AboutWindows Registry |
| CATEGORIES ABOUT WINDOWS REGISTRY | |
| windows components | |
| registry | |
| configuration files | |
|
The ''Windows registry'' was introduced to tidy up the profusion of per-program INI File s that had previously been used to store configuration settings for Windows programs.1 These files tended to be scattered all over the system, which made them difficult to track. STRUCTURE The Registry is split into a number of logical sections, or "hives".2 Hives are generally named by their Windows API defintions, which all begin "HKEY". They are abbreviated to a three- or four-letter short name starting with "HK" (e.g. HKCU and HKLM). Registry keys are specified with a syntax similar to Windows' path names, using backslashes to indicate levels of hierarchy. E.g. HKEY_LOCAL_MACHINE\Software\Microsoft\Windows refers to the subkey "Windows" of the subkey "Microsoft" of the subkey "Software" of the HKEY_LOCAL_MACHINE key. Values are not referenced via this syntax. Value names can contain backslashes which would lead to ambiguities were they referred to this way. The Windows API functions that query and manipulate registry values take value names separately from the key path and/or handle that identifies the parent key. The HKEY_LOCAL_MACHINE and HKEY_CURRENT_USER nodes have a similar structure to each other; applications typically look up their settings by first checking for them in "HKEY_CURRENT_USER\Software\Vendor's name\Application's name\Version\Setting name", and if the setting is not found looking instead in the same location under the HKEY_LOCAL_MACHINE key. When writing settings back, the reverse approach is used — HKEY_LOCAL_MACHINE is written first, but if that cannot be written to (which is usually the case if the logged-in user is not an administrator), the setting is stored in HKEY_CURRENT_USER instead. Each of these keys is divided into subkeys, which may contain further subkeys, and so on. Any key may contain entries with various types of values. The values of these entries can be: HKEY_CLASSES_ROOT Abbreviated HKCR, HKEY_CLASSES_ROOT stores information about registered applications, including associations from file extensions and OLE object class ids to the applications used to handle these items. On Windows 2000 and above, HKCR is a compilation of HKCU\Software\Classes and HKLM\Software\Classes. If a given value exists in both of the subkeys above, the one in HKCU\Software\Classes is used.3 HKEY_CURRENT_USER Abbreviated HKCU, HKEY_CURRENT_USER stores settings that are specific to the currently logged-in user. The HKCU key is a link to the subkey of HKEY_USERS that corresponds to the user; the same information is reflected in both locations. HKEY_LOCAL_MACHINE Abbreviated HKLM, HKEY_LOCAL_MACHINE stores settings that are general to all users on the computer. This key is found within the file %SystemRoot%\System32\Config\system on NT-based versions of Windows. Information about system hardware is located under the SYSTEM key. HKEY_USERS Abbreviated HKU, HKEY_USERS contains subkeys corresponding to the HKEY_CURRENT_USER keys for each user registered on the machine. HKEY_CURRENT_CONFIG Abbreviated HKCC, HKEY_CURRENT_CONFIG contains information gathered at runtime; information stored in this key is not permanently stored on disk, but rather regenerated at boot time. HKEY_PERFORMANCE_DATA This key provides runtime information into performance data provided by either the NT kernel itself or other programs that provide performance data. This key is not displayed in the Registry Editor, but it is visible through the registry functions in the Windows API. EDITING Manual editing ]] The registry can be edited manually in Microsoft Windows by running regedit.exe or regedt32.exe in the Windows directory. However, careless registry editing can cause irreversible damage. Thus, performing back-up for registry is highly recommended. Many optimization and " Hacking " tools are available to modify this portion of the Windows operating system; it is preferable not to use them unless one has a knowledge of registry workings or wishes to learn more about the registry. A simple implementation of the current registry tool appeared in Windows 3.x , called the "Registration Info Editor" or "Registration Editor". This was basically just a Database of applications used to edit embedded OLE objects in documents. Windows NT introduced permissions for Registry editing. Windows NT 4 and Windows 2000 were distributed with both the Windows 9x REGEDIT.EXE program and Windows NT 3.x's REGEDT32.EXE program. There are several differences between the two editors on these platforms:
Windows XP was the first system to integrate these two programs into one, adopting the old REGEDIT.EXE interface and adding the REGEDT32.EXE functionality. The differences listed above are not applicable on Windows XP and newer systems; REGEDIT.EXE is the improved editor, and REGEDT32.EXE is simply a Stub that invokes REGEDIT.EXE. Command line editing The registry can be manipulated from the Command Line with the reg.exe utility. It is included in Windows XP and Windows Vista and can be downloaded separately for previous versions. An alternative location are the Resource Kit CD's or the original Installation CD of Windows. reg.exe Operation List Some programming languages, like Visual Basic , offer built-in runtime library functions that enable programs to store settings in the registry. Another way is to use the Windows Support Tool Reg.exe by executing it from code.5 Many scripting languages such as also enable registry editing from scripts. LOCATIONS The Registry is stored in several files; depending upon the version of Windows, there will be different files and different locations for these files, but they are all on the local machine, except for the Ntuser.dat files. There is one such file per user that contains the information in HKEY_CURRENT_USER; it may be placed on another computer to allow for Roaming Profiles . The policy file, which is usually stored on a server in the local network, may also be located remotely. Windows NT, 2000, XP, Server 2003, and Vista The following Registry files are stored in %SystemRoot%\System32\Config\:
The following files are stored in each user's profile folder:
Windows 95, 98, and Me The registry files are named User.dat and System.dat and are stored in the C:\WINDOWS directory. In Windows ME, Classes.dat was added. Windows 3.11 The registry file is called Reg.dat and is stored in the C:\WINDOWS directory. POLICY FILES Since Windows 95, administrators can use a special file to be merged into the registry, a policy file. The policy file allows administrators to prevent non-administrator users from changing registry settings like, for instance, the security level of IE and the desktop background wallpaper. The policy file is primarily used in a business with a large number of computers where the business needs to be protected from the users and the users need to be protected from themselves. The default extension for the policy file is .pol. The policy file filters the settings it enforces by user and by group (a "group" is a defined set of users). To do that the policy file merges into the registry, preventing users from circumventing it by simply changing back the settings. The policy file is usually distributed through a LAN, but can be placed on the local computer. Policy file editor The policy file is created by a free tool by Microsoft that goes by the filename poledit.exe for Windows 95/Windows 98 and with a computer management module for NT-based systems. The module will not work in Windows XP Home Edition, but it does work in the Professional edition. The editor requires administrative permissions to be run on systems that uses permissions. The editor can also directly change the current registry settings of the local computer and if the remote registry service is installed and started on another computer it can also change the registry on that computer. The policy editor loads the settings it can change from .adm files, of which one is included, that contains the settings the Windows shell provides. The .adm file is plain text and supports easy localisation by allowing all the strings to be stored in one place. The policy editor has been renamed to Group Policies in newer versions of Windows. ADVANTAGES Changing from having one or more INI File s per program to one centralised registry has its good points:
DISADVANTAGES However, the centralized Registry introduces some problems as well:
Windows 9x OS On Windows 9x computers, an older installation can have a very large registry that slows down the computer's startup and can make the computer unstable. This has led to frequent criticisms that the registry leads to instability. However, as the on-disc structure of the registry is entirely different on the NT line of Operating Systems (including Windows XP and Vista) than Windows 9x series OS, slowdown due to registry bloat now occurs much less frequently. ALTERNATIVES IN OTHER OPERATING SYSTEMS Other systems use separate configuration files for separate application subsystems, but group them together for ease of management. For instance, system-wide configuration files (information which would appear in HKEY_LOCAL_MACHINE on Windows) are traditionally stored in files in /etc/ and its subdirectories. Per-user information (information that would be in HKEY_CURRENT_USER) is stored in hidden directories and files (that start with a period) within the user's home directory. Applications running on Apple Inc. 's Mac OS X operating system typically store settings in Property List files which are usually stored in each user's Library folder. An advantage of this is that corruption to one of these files will normally only affect a single application, whereas corruption of one of the Registry hives can have system-wide effects. However, Mac OS X also has a system database called NetInfo that stores system-wide settings such as user account details and network configuration. RISC OS also allows applications to be copied into directories easily, as opposed to the separate installation program that typifies Windows applications. If one wishes to remove the application, it is possible to simply delete the folder belonging to the application.7 This is possible because RISC OS does not support multi-user environments with different settings for each user. IBM AIX (a Unix derivant) uses a registry component called Object Data Manager (ODM). The ODM is used to store information about system and device configuration. An extensive set of tools and utilities provides users with means of extending, checking, correcting the ODM database. The ODM stores its information in several files, default location is /etc/objrepos. The GNOME desktop environment uses a registry-like interface called GConf for storing configuration settings for the desktop and applications. However, in GConf, all application settings are stored in separate files, thereby eliminating a Single Point Of Failure . The Elektra Initiative provides an alternative back-end for text configuration files for the Linux operating system, similar to the registry. SEE ALSO REFERENCES EXTERNAL LINKS
|
|
|