Reprinted from: http://www.newxing.com/Tech/Soft/system/84.html Windows The Registry File (system. dat And user. dat) is the core database of windows. It is very important. You can optimize Windows performance by modifying the data in the Registry file. However, modifying the registry may also cause the entire windows System Crash! Therefore, you must back up the registry before performing operations on the registry or before installing software. The following describes Reg. File writing method.
I. Primary Key operations
1. Create a primary key
For example, we want Create a primary key named "my software. You can open notepad and write the following content:
Note: (1) regedit4 of the first line It must be in uppercase. The second line must be an empty line. A carriage return is required at the end. (2) The first line starting with Reg files such as Windows 95/98, me, and NT4.0 is "regedit4 ". Windows 2000/XP is "Windows Registry Editor Version 5.00", which is used to distinguish the operating system used. In fact, "regedit4" is suitable for any Windows operating system (9x/2000/XP/2003 ). Then save the file as Reg Format. For example, Reg. Reg
Double-click the file and two confirmation messages will pop up. After confirmation, the computer will write the registry project we wrote to the Registry file. You can open regedit.exe To check.
2. delete a primary key
For example, if we want to delete the primary key named "my software" We just created, we can write this in Notepad:
Note the minus sign "- ", That's what deletion means. Save it as Reg and run it. The "my software" primary key is deleted.
Ii. Operations on key-value items
1. Add a key-value item
To create a new key-value item, you must specify the branch of the key-value, the name of the key-value, the type of the key-value, and the value of the key-value ( Data ). For example Create a new name named "nodrives". The type is "DWORD" and the value is "00000004 ". . You can write as follows:
Note: (1) Key value type DWORD It must be in lower case, and Other types such as hex must also be in lower case; (2) When creating a key-value item, if the primary key branch of the key value does not exist, the system will automatically create the branch when adding the new key value; (3) when creating a string-type key value, if the string contains a path separator, the path separator should be a double slash "// . For example:
Besides Windows XP In other Windows versions, there are only three types of values: DWORD, binary, and string. In Reg In the file, the DWORD value is represented by DWORD, And the binary value is represented by hex. The string value can be enclosed by quotation marks directly. For Windows XP In addition to the three types, two types are added: Multi-string value and extensible string value.
In Reg In the file, the default key value is represented by @ without quotation marks. 2. delete a key-Value Project
For example, we want to delete the "nodrives "Key value, which can be written as follows:
Notice the minus sign after the equal sign. This is the meaning of deletion.
3. Modify the key value
For example, we want "The value of the key-value item is changed from 00000004 to 000c, so we can write it like this:
This is similar to the method used to create a new key value. The computer automatically uses the C Replace 00000004.
All of the preceding operations are performed at a time. What if you want to perform "batch" operations at a time? It's easy to write the project you want to operate into Reg one by one. File. If you operate the key values under the same primary key, you only need to write the branch where the key value is located once, because their branches are the same. For example:
The above is Reg. All file compilation methods. |