Windows registry is a set of data files that help Windows control hardware, software, user environment and Windows interface. The registry is contained in two files system.dat and user.dat in the Windows directory and their backups system.da0 and user.da0. You can access the registry database through the regedit.exe program in the Windows directory. Previously, in the early version of windows (before Win95), these functions were realized by win.ini, system.ini, etc. Ini files related to the application.
In the windows operating system family, the two files, system.ini and win.ini, contain all the control functions and application information of the operating system. System.ini manages computer hardware, and win.ini manages desktops and applications. All drivers, fonts, settings and parameters will be saved in. Any new program will be recorded in. Ini file. These records will be referenced in the program code. Because of the file size limit of win. INI and system.ini, programmers add assistance. Ini file to control more applications. For example, Microsoft Excel has an excel.ini file that contains options, settings, default parameters and other information related to the normal operation of Excel. In system.ini and win.ini, just point out the path and file name of excel.ini
As early as Dos and Win3.x era, most applications used ini files (initialization files) to save some configuration information, such as setting paths and environment variables. System.ini and win.ini control the characteristics and access methods of all windows and applications, and run well in the environment of a few users and a few applications. With the increase of the number and complexity of applications, it is necessary to provide the. Ini file. In this way, in a constantly changing environment, everyone will change after the application is installed in the system. Ini file. However, no one will delete it. Ini files, so the two files, system.ini and win.ini, will get bigger and bigger. Every addition of content will lead to slower and slower system performance. And every time you apply the upgrade, there is a problem: the upgrade will add more parameter items but never delete the old settings. There is another obvious problem. The maximum size of. The ini file is 64KB. In order to solve this problem, software vendors began to support their own. Ini files, and then point to specific ini files, such as win.ini and system.ini files. So, how heavy. The ini file affects the normal access level setting of the system. If the application's. Ini file and win. INI files conflict, whose priority is higher?
The registry was originally designed as a data file related to the reference file of the application, and finally expanded to include all the functions of the 32-bit operating system and the application. The registry is a set of files that control the appearance of the operating system and how to respond to external events. These "events" range from direct access to hardware devices to how interfaces respond to specific users to how applications run. Because of its purpose and nature, the registry becomes very complicated. It is designed for 32-bit applications, and the file size is limited to about 40MB. The powerful registry database is used to manage the system hardware facilities, software configuration and other information in a unified and centralized way, which is convenient for management and enhances the stability of the system. The most intuitive example is why different users under windows can have their own personalized settings, such as different wallpapers and different desktops. This is achieved through the registry.
Therefore, the registry is the core "database" for Windows9x/Me/NT/2000 operating system, hardware devices and client applications to run normally and save settings. Is a huge tree-like hierarchical database. It records the association between the software installed by the user on the machine and each program; It includes the hardware configuration of the computer, including automatically configured plug-and-play devices, descriptions of various existing devices, status attributes and various status information and data. ↑
Second, what does the registry do?
Registry is a data file designed for all 32-bit hardware/drivers and 32-bit applications in Windows NT and Windows95. 16 bit driver can't work under Windows NT, so all devices are controlled by the registry, which is generally controlled by BIOS. Under Win9x, 16-bit drivers will continue to work in real mode, and they are controlled by system.ini, while 16-bit applications will work under NT or Win9x, and their programs will still refer to win.ini and system.ini files for information and control.
Without the registry, the operating system will not be able to obtain the information needed to run and control the connected devices and applications, and correctly respond to user input.
In the system, the registry is a database that records the settings and locations of 32-bit drivers. When the operating system needs to access hardware devices, it uses drivers, even devices supported by BIOS. Devices without BIOS support must install drivers, which are independent of the operating system, but the operating system needs to know where to find them, file names, version numbers, other settings and information, and devices cannot be used without recording them in the registry.
Examples of registry control user modes are:
★ Control panel function;
★ Desktop appearance and icons;
★ Network parameters;
★ Browser functions and features. ↑
Some of these functions have nothing to do with users, and some are aimed at users.
Computer-related controls are based on the computer name and have nothing to do with the logged-in user. An example of a control type is installing an application. No matter which user, the availability and access of the program are unchanged. However, the icon for running the program depends on the user who logs on to the network. The availability and priority of network protocols are computer-based, but the current connection is related to user information.
The following are some examples of basic and computer control entries in the registry:
★ access control;
★ Login confirmation;
★ Enjoy files and printers * * *;
★ Network card settings and protocols;
★ System performance and virtual memory settings.
Without the registry, Win9x and Windows NT are unlikely to exist. They are so complex that they cannot be controlled by the past. Ini files, and their extensibility requires almost unlimited installation and use of applications, which is realized by the registry. However, the registry is better than. Ini file, understanding its working principle, function and usage is the key to effective management system.
In the system, the registry controls all 32-bit applications and their functions, as well as the interaction of multiple applications, such as copying and pasting. It also controls all hardware and drivers. Although most of the settings can be installed through the control panel, understanding the registry is still the basic knowledge of Windows NT and Win9x system management. To sum up, various parameters are stored in the registry, which directly control the startup of Windows, the loading of hardware drivers and the running of some Windows applications, thus playing a core role in the whole system. It includes: (1) Configuration and status information about software and hardware. Initial conditions, preferences and uninstall data of application and resource manager shells are all stored in the registry. (2) The setting and permission of the whole system of networked computers, the association between file extension and application programs, and the description, status and attributes of hardware components. (3) Performance records and other underlying system status information, as well as other data. If the registry is destroyed, the startup process of Windows will be abnormal, and in the worst case, the whole system may be completely paralyzed. Therefore, it is very important for Windows users to correctly understand and use it, especially to back up and restore the registry in time when problems occur. Learning the knowledge of registry and related applications can make your computer operation more handy! So as to become a veritable computer expert!
Three. Terminology related to the Register:
(1) Registry: It is a tree-like hierarchical database (as shown in figure 1). Physically, it is just two files: System.dat and User.dat Logically, it is the configuration data that users see in the registry editor.
(2) HKEY: "root key" or "primary key", whose icon is somewhat similar to the icon of a folder in the Explorer. Windows98 divides the registry into six parts and names it HKEY name, which means the handle of a key. (Figure 2)
③ key: contains additional folders and one or more values.
④ subkey: a key (subkey) that appears under a key (parent key).
⑤ branch: indicates a specific subitem and all its contents. Branches can start at the top of each registry, but it is usually used to explain a key and all its contents. 6. Value entry: Ordered value with name and value. Each key can contain any number of value items. Each value item consists of three parts: name, data type and data. (as shown in figure 3)
★ Name: any combination of characters, numbers, symbols and spaces, excluding backslashes. You cannot have the same name in the same item.
★ Data type: including string, binary and doubleword.
String (REG_SZ): As the name implies, a string of ASCII characters. For example, "Hello World" is a string of words or phrases. In the registry, string values are usually used to represent the description of files and the identification of hardware. Usually it consists of letters and numbers. The registry always displays strings in quotation marks. REG_BINARY: For example, F03D990000BC is a binary value with no length limit. In Registry Editor, binary data is displayed in hexadecimal.
Double Word (REG_DWORD): Literally, it should be doubleword, a double-byte value. It consists of 1-8 hexadecimal data and can be edited in hexadecimal or decimal mode. Such as D 1234567.
★ Data: the specific value of the value item, which can account for 64KB at most.
⑦.Default: Each key contains at least one value item, which is called default, and it is always a string.
Four, the internal organizational structure of the registry and their relationship.
In Windows NT, the registry data of computer configuration and DEFAULT user settings are saved in the following five files: default, SAM, SECURITY, SOFTWARE, SYSTEM and NTUSER. DAT Windows9x/Me/2000 stores all registry files in two files: System.dat and User.dat They are binary files and cannot be viewed with a text editor. They exist in the Windows directory and have implicit, system and read-only properties. System.dat contains computer-specific configuration data, and User.dat contains user-specific data. When logging in with a user name, the location of the User.dat file is located in the C:\Windows\profiles\ user name directory, and the default User.dat file is kept in the C:\Windows directory for new users. The internal organizational structure is a tree-like hierarchy similar to directory management (as shown in figure 1).
The WINDOWS registry has six keys, which is equivalent to a hard disk being divided into six partitions.
Enter RegEdit in the Run dialog box, and then click OK to run the Registry Editor.
The left pane of figure 1 shows the root entries of the registry, and there are six such root entries. These root keys are capitalized and prefixed with HKEY_. This command specifies a symbolic variable based on the Win32 API registry function keyword.
Although in the registry, the six root keys seem to be parallel and irrelevant. But in fact, the information stored in HKEY _ class _ ROOT and HKEY_CURRENT_CONFIG are all part of the information stored in HKEY_LOCAL_MACHINE, while the information stored in HKEY_CURRENT_USER is only part of the information stored in HKEY_USERS. HKEY_LOCAL_MACHINE includes all information in HKEY _ class _ root and HKEY _ current _ user. Every time the system is started, the information in HKEY's current user will be mapped so that users can view and edit the information.
In fact, HKEY _ local _ machine \ software \ class is HKEY _ class _ root, which is specially used as the root key for users to view and edit. Similarly, HKEY _ Current _ Configuration \ System \ Current Control is HKEY _ Local _ Machine \ System \ Current Control.
HKEY users save the user information of the default user and the currently logged-in user. HKEY Current User saves the user information of the currently logged-in user.
HKEY_DYN_DATA keeps the dynamic data when the system is running, reflecting the current state of the system, which is different every time, even on the same machine.
According to the above analysis, the information in the registry can be divided into two categories: HKEY_LOCAL_MACHINE and HKEY_USERS. For detailed information about these two categories, please refer to the following introduction.
Five, the role of bonds six write
The registry uses "keywords" and their "key values" to describe the login items and their data. All keywords begin with "HKEY". For example, keywords are more like files in a directory in a browser under Windows9X, and each file will have its own unique content and attributes. We can easily add, modify, query and delete every keyword in the registry editor. Keywords can be divided into two categories: one is defined by the system, which is generally called "predefined keywords"; The other is application-defined, and the login items are different according to different application software. In the registry, all data are organized by tree structure keys and subitems, which is very similar to the directory structure. Each key contains a specific set of information, and the key name of each key is related to the information it contains. If the registry key contains subkeys, there will be a "+"symbol to the left of the folder representing the registry key in the Registry Editor window, indicating that there is more content in the folder. If the user opens the folder, the "+"will become "-". Here is a brief introduction to the six predefined keys of the system.
1.HKEY _ user
The root key stores the user ID and password list stored in the password list of the local computer, that is, user settings. The pre-configuration information of each user is stored in the root key of HKEY user. Keys user is one of the root keys accessed in the remote computer. Its content depends on whether the computer has activated the user profile. If the user profile is not activated, you can see a file named. Default, including various settings related to all users, and matching with users. \ DAT files under \Windows. If the user profile is activated and the login is performed correctly, there is also a subitem of the user name, which is the name of the user login.
2.HKEY _ Current _ User
This root key contains the currently logged-in user information stored in the local workstation, including the user login username and temporary password (note: this password is hidden when entered). When a user logs on to Windows 98, his information is copied from the corresponding item in HKEY user to the current HKEY user. There are 7 sub-keywords under HKEY _ Current _ User. Except for "remote access", the other six are predefined by the system.
AppEvents is a subitem that registers registered application events.
The control panel relates to the setting of the control panel.
Information about the installation path of InstallLocationsMRU windows.
Keyboard Layout Information about keyboard settings.
Network information about network settings.
A sub-keyword established when RemoteAccess installs IE, which contains information about the application.
Information about the software.
3.HKEY _ Current _ Configuration
This root key stores data (such as monitors, etc.) that define the desktop configuration of the current user. ), Last Used Document List (MRU) and other information about the Chinese version of Windows 98 installed by the current user.
4.HKEY _ Class _ Root
This key is composed of multiple subkeys, which can be divided into two types: one is the extension of the registered file, and the other is the information about various file types. The subitems in the left column are all registered file extensions. Among the file extensions registered in the registry, there are system default extensions and application-defined extensions. Only when an application registers a user-defined extension in the registry can the system identify and associate related documents, but only after the extension is registered can the system automatically associate them. According to the extension of the application installed in Chinese version of Windows 98, root key indicates the name of its file type.
When installing Chinese version of Windows 98 for the first time, RTF (Rich Text Format) files are associated with WordPad, but after installing Chinese Word 6.0 in the future, when you double-click a RTF file, Word will be automatically activated. HKEY _ class _ root stored in the system. DAT will replace the setting item in the [Extension] section of WIN. INI file, which links the application with the file extension, and it also replaces the similar setting item in the Reg.dat file in Windows 3.x.
5.HKEY _ Local _ Machine
The core of the registry, the configuration of computer software and hardware all exist here. It includes the following eight parts: configuration, driver, Enum plug and play, hardware, network, security, software and system. Each part also includes many sub-items. The root key stores the hardware data of the local computer, and the sub-keywords under the root key are included in the system. DAT to provide the information required by HKEY_LOCAL_MACHINE, or in a set of keys accessible in a remote computer. Many subitems in this root item are similar to the settings in the System.ini file.
6.HKEY_DYN_DATA
This root key stores the dynamic data of the runtime system, which will change every time it is displayed, so the information under this root key will not be put into the registry.
You can open it by typing regedit enter in start-run, or by using C:\WINDOWS\regedit.