When we configure or modify the registry, sometimes we can use a file with an extension of Reg, what is this file? What does it do, how to set it up, and how to complete the various operations on the registry? Here's the one by one-way for you!
What is a reg file?
REG file in practice is a registry script file, double-click the reg file to import the data into the registry. Resolution agreed to the format, we can use the reg file directly to the registry to perform any corrective action, and its operation on the registry can not be restricted by Regedit.exe, and thus more powerful, sensitive; In addition, because Reg files can be opened and edited with any text editor such as Notepad , correction, you can attack the wrong time, the resolution changed back to the data in the reg file and then import, complete the recovery operation, so it is more simple and safe.
What does a reg file do?
REG file about the operation of the Registry can be attributed to the following: New primary key, delete primary key, new key value, fixed key value, delete key value, we distinguish to look. The following practice takes the example of WINDOWS2000/XP.
1. New PRIMARY Key
For example, we want to create a primary key under primary key [Hkey_current_usersoft-ware] called "New primary key title." So, we can open Notepad and write the following:
Windowsregistryeditorver-sion5.00[hkey_current_usersoftware new primary key title]
When the input is complete, save as a *.reg file, and then double-click to import it into the registry, as shown in Figure 1, we can see the effect of the correction with the vertical pole.
2, delete the primary key
To delete a primary key in the registry with a reg file, you can add a-symbol to the primary key path in []. It is worth noting that removing the primary key operation will delete all subkeys and their key items under the primary key. For example, to delete the primary key that we just added, you can enter the following on Notepad:
windowsregistryeditorver-sion5.00
[-hkey_current_usersoftware new primary key title]
Next, simply save as a *.reg file and double-click it to import it into the registry immediately.
3, new key value
Right-click the key Value Entry window on the right side of Registry Editor and pick the new menu item to see that the key values are subdivided into: string values, binary values, DWORD values, and so on.
String value (REG_SZ), which is commonly used as a file drawing and hardware flag, can be a letter, a number, or a Chinese character, but it is a fixed length text string, the maximum length cannot exceed 255 characters. The general performance of the Reg file is: "A" = "* * *". Binary Value (REG_BINARY), in general, the large and small number of hardware component information is stored in binary data, and then the hexadecimal format is displayed in Registry Editor. The type value has no length qualification, can be arbitrary byte long, reg file in general performance: "A" =hex:01,00,00,00.
Dwoed Value (REG_DWORD), many of the parameters that are equipped with the drive order and service are this type, displayed in binary, hexadecimal, or decimal format in Registry Editor. The general performance of the Reg file is "a" =dword:00000001.
If you use the operating system is win-dowsxp, then in addition to the string value, binary value, DWORD value, you can also see multiple string values, can enlarge the string value of two types of key value, but these two basic do not, here do not make a profile. On the above we have seen the value of the key and its format in the reg file, let's take a closer look at how to create a new key value.
To create a new key value entry, you must indicate the branch that contains the key value, the title of the key value, the type of the key value, and the value of the key value (data. For example, to create a new primary key named "reg file test" Under Branch [Hkey_cur-rent_user Software], and configure the acquiescence key value to "test" and distinguish between adding "string" key item (string value, binary key item (binary value, "Double-byte" The key value item (the DWORD value.) You can write this:
windowsregistryeditorver-sion5.00
[hkey_current_usersoftware reg file Test]
@= "Test" "string" = "Ceshi" "Double-byte" =hex:01,00,00,00 "Dword value" =dword:00000001 in a reg file, the DWORD value is represented in DWORD, and the binary value is represented by Hex. String values enclose the content directly in quotation marks. It is worth noting that key value types such as DWORD, Hex, and so on must also be lowercase, and, in addition, assuming that the string contains a path delimiter when setting the key value of the string type, the path delimiter must be represented by a double slash "". There is still, in the Reg file, the acquiescence key value is expressed in @, and there is no quotation mark. As shown in Figure 2, you can see this correspondence in ten clear figures.
4, Correction key value
Fixing a key-value entry and setting a new key value are similar, simply by correcting the corresponding data in the reg file. For example, to change the DWORD value in the example above to 00000000, we can write this: windowsregistryeditorver-sion5.00
[hkey_current_usersoftware reg file Test] "DWORD value" =dword:00000000 after we perform the import operation, the new data will automatically cover up the old data, for example, in this case, automatically using the 00000000 replaces the 00000001.
5, delete the key value
Deleting key items with a reg file is also a resolution-number complete, just put-the symbol on the key value items after the equal sign of the line. We want to remove the multiple key-value items we added in Figure 2, which we can write as shown in Figure 3:
windowsregistryeditorver-sion5.00
[hkey_current_usersoftware reg file Test]
@= "Test" "string" =-"Double-byte" =-"DWORD value" =-notice the minus sign after the equals sign, which is the meaning of the deletion.
Here, about the reg file we are finished, the companions can be in practice a lot of experiments, gradually will be handy.