Create a reg file. How to create a .reg file to work with the Windows registry

This article outlines basic principles work with Windows registry, knowledge of which will be useful to you in setting up operating system using registry tweaks.

Terminology

Before we get down to business, we need to define the terminology. I'm using official Microsoft terminology, so the terms are quite consistent with Registry Editor items.

Figure 1 - Registry Editor

As you can see, there are no “branches” or “keys” here. Now to the point.

REG file

REG file is text file with the REG extension, compiled in a specific format.

REG file format

Below is an example of a REG file that disables the menu recent documents.

Windows Registry Editor Version 5.00 ;Disable the menu of recent documents "NoRecentDocsMenu"=hex:01,00,00,00

Creating a REG file

Creating a REG file is very simple. Copy the code to any text editor(eg Notepad). Press CTRL+S and save the file with any name and extension.reg, putting both in quotes to avoid txt extension.

Figure 2 - Creating a REG file

REG file syntax

  • Windows Registry Editor Version 5.00— the file header, which is an integral part of it. You can also see REGEDIT4 as a header - this is Windows format 98 / NT 4.0, which, however, will also be understood by newer operating systems Windows systems. More information about the differences in formats can be found on the JSO FAQ website (in English).
  • ;Disable recent documents menu- a comment. All lines starting with ; (semicolon) represent comments.
  • is a registry key. Graphically (in the Registry Editor) it represents the path to the parameter. In REG file format, sections are always enclosed in square brackets. In this example, the Explorer (sub)key belongs to the HKEY_CURRENT_USER key.
  • "NoRecentDocsMenu"=hex:01,00,00,00— registry parameter and its meaning. Depending on the value of the parameter, the behavior of the operating system or object changes. Many parameters can be configured in graphical interface operating system, but not all. In such cases, registry editors, tweakers, or REG files are used to change the parameter.

A REG file can contain multiple registry keys and settings, but the header is only used at the very beginning.

Windows Registry Editor Version 5.00 ;Disable reboot in case of BSOD "AutoReboot"=dword:00000000 ;Disable notification on the welcome screen about unread messages "MessageExpiryDays"=dword:00000000

This REG file was obtained by exporting from the registry editor regedit.exe. Using REG files, you can make changes to system registry- This operation is called importing registry settings.

Exporting registry settings

Exporting registry settings is an easy task. Typically, settings are exported before changes are made to the registry ( backup), or in order to create a REG file for subsequent import into the registry of another computer or during an automatic system installation.

You can export registry settings in a variety of ways.

Windows Registry Editor (regedit.exe)

Windows OS includes a program for editing the registry - regedit.exe. Since it is located in the system directory, to run it in command line You don’t need to specify the full path (for example, the following sequence will suffice: Start - Run - regedit - OK).

In order to export a registry key, just right-click on it and select from context menu team Export(in Windows 2000 this command is located in the menu File).

Other registry editors

There are a great many programs for making changes to the system registry, which also have the ability to export settings. If you often work with the registry, then you will probably need a program that has an address bar. IN address bar you can paste the registry key you copied (from an article or from a forum post) and quickly go to the required parameter. An example of such a program is RegWorks.

Command line

From the command line, you can export registry settings using the command REG EXPORT, which has the following syntax.

REG EXPORT Full path to the registry key in the form: ROOT\Subkey (for local computer only). Root partition. Values: [ HKLM | HKCU | HKCR | HKU | HKCC]. The full path to the registry key in the selected root partition. The name of the disk file to export. Examples: REG EXPORT HKLM\Software\MyCo\MyApp AppBkUp.reg Exports all subsections and parameter values ​​of the MyApp section to the file AppBkUp.reg

Importing registry settings

There are several ways to import registry settings.

Running a REG file using the GUI

This is the easiest way. It consists of running a REG file containing the necessary parameters by double-clicking or from the command line.

Double click

As trivial as it sounds, you can make changes to the registry by double-clicking on the REG file. However, first the system will clarify whether you really want to do this. If the answer is positive, changes will be made.

Figure 3 - The system requests confirmation to make changes.

Because of this query, this method is not suitable for importing settings into the registry during automatic installation systems. But there are other ways.

Command line

To import REG files from the command line, there is a command REGEDIT. By typing at the command line

REGEDIT C:\hklm.reg

You will get exactly the same dialog box as when double click mice. You can suppress the appearance of the dialog box by running the command with the parameter /S. This is the method most often used during automatic installation of Windows.

REGEDIT /S C:\hklm.reg

REG ADD command

Using the command REG ADD You can also import registry settings. It is convenient because commands for importing parameters can be included in batch file, which also performs other tasks (i.e. there is no need for an additional REG file). For example, this command is often used to import registry values ​​into the RunOnceEx key and then install programs the first time you log on. The command syntax is quite simple - see it yourself by running the command on the command line REG ADD.

INF file

You can also import settings into the registry using INF files. Their general syntax is somewhat more complex than that of REG files, but writing directly to the registry is quite simple. Below is an example from the Msgina addon

Signature="$Windows NT$" Msgina OptionDesc="Msgina" Tip="GINA Login Library" Modes=0,1,2,3 AddReg=Msgina.AddReg HKLM,"Software\Policies\Microsoft\Windows\System\ Shutdown","ShowHibernateButton",0x10001,1 HKLM,"Software\Policies\Microsoft\Windows\System\Shutdown","HibernateAsButton",0x10001,1

Note. More information about INF files can be found in .

We hope that we helped you solve the problem with the REG file. If you don't know where you can download an application from our list, click on the link (this is the name of the program) - you will find more detailed information regarding where to download a secure installation version of the required application.

A visit to this page should help you answer these or similar questions specifically:

  • How to open a file with a REG extension?
  • How to convert a REG file to another format?
  • What is the REG file format extension?
  • What programs support the REG file?

If, after viewing the materials on this page, you still have not received a satisfactory answer to any of the questions presented above, this means that the information presented here about the REG file is incomplete. Contact us using the contact form and write what information you did not find.

What else could cause problems?

There may be more reasons why you cannot open a REG file (not just the lack of an appropriate application).
Firstly- REG file may not be linked correctly (incompatible) with installed application for its maintenance. In this case, you need to change this connection yourself. To do this, right-click on the REG file that you want to edit, click the option "To open with" and then select the program you installed from the list. After this action, problems with opening the REG file should completely disappear.
Secondly- the file you want to open may simply be damaged. In this case, it would be best to find a new version of it, or download it again from the same source (perhaps for some reason in the previous session the download of the REG file did not finish and it could not be opened correctly).

Do you want to help?

If you have Additional Information about the REG file extension, we will be grateful if you share it with users of our site. Use the form below and send us your information about the REG file.

Reg file structure
Chebotarev Igor

Knowledge of the Windows registry will not be complete without the ability to write a reg file. Let's start with what it is. A reg file is a file that has a specific structure and contains information that can be imported into the registry. If work with the registry editor was blocked (you can read how to do this in the article), then the most the easy way editing the registry will involve creating and importing a reg file (of course, you can go into DOS, into protected mode, and use other programs, but this is much more complicated, and most importantly longer).
Reg files have certain structural requirements. Let's start with the fact that in the first line of the file you must enter
REGEDIT4
Please note that the letters must be large. Apart from this, there should be nothing in the first line. After this text there MUST be empty line. Then, the registry section is indicated in which you need to register or change some parameters. The section title must be enclosed in square brackets [...]. Below are the parameters that need to be added, one parameter per line. If you need to make changes in several sections, then you must leave one blank line between the last parameter of the previous section and the name of the next section. Might be a little confusing, but here's what it should look like:
REGEDIT4
"param1"="znachenie1"
"param2"="znachenei2"
"param3"="znachenie3"
"param_1"="znachenie_1"
The last line in the file must be BLANK. Once you have created such a file, simply run it like regular program, you will be prompted to make changes to the registry, and after a positive response, the information from the file will be imported. Windows will report the import results in the window that appears after this.
Now a few words about the parameters that can be added. As you may have noticed, the example above adds parameters using lines like "param1"="znachenie1". Those. This adds a STRING parameter with the name "param1" and the value "znachenie1". But there are also binary and DWORD parameters. The recording format for adding them is slightly different. For DWORD type parameters the string is used
"param"=dword:XXXXXXXX
Here "param" is the name of the parameter, dword - indicates the type of this parameter (the letters must be small!) and after the colon there is a value of eight digits in hexadecimal (!) format. However, most DWORD parameters have a value of either 0 or 1, which means you should write either 00000000 or 00000001 instead of XXXXXXXXX. Spaces are not allowed in the line.
To add a binary parameter, the recording format is slightly different:
"param"=hex:XX,XX,XX,....
Now I will decipher this line. Well, everything is clear with the name of the parameter, after the "=" sign there is a hex, i.e. it is indicated that this will be a binary parameter, then they go hexadecimal numbers, separated by a comma. For example, if you need to add a binary parameter equal to "be 00 00 00", then you write the line
"param"=hex:be,00,00,00
There are "Default" parameters in the registry. To assign them some value through a reg file, you need to add the following line:
@="znachenie"
Here the @ symbol indicates that we are assigning the value of the parameter to "Default". Note that it is not enclosed in quotation marks.
Now I will give an example of a simple reg file that registers a site in the registry that sets the home page in Internet Explorer:
REGEDIT4
"Start Page" = "http://www.site/"
In my opinion, everything is very simple and clear. But reg files have one peculiarity: they cannot be used to delete parameters in the registry, although you can delete an entire section. To remove a section from the registry, place the “-” symbol in square brackets before its name. This is what it looks like:
[-HKEY_LOCAL_MACHINE\Software\QuickSoft\QuickStart]
Thanks to this entry, the "QuickStart" subsection from the "QuickSoft" section will be removed with all its contents. However, what about the parameters? After all, they cannot be deleted. Thus, setting restrictions on access to various settings Windows shell, as described in the article, is done using DWORD type parameters. In this case, if the parameter value is 1 (00000001), then the limitation is enabled, and if it is 0 (00000000), then the limitation is disabled. Thus, it is not necessary to delete the parameters; it is enough to simply assign them values ​​equal to zero.
Note regarding deletion made by Nikolai Basmanov:
Using REG files you can delete parameters. Syntax:
REGEDIT4
"xxx"=-

Here, perhaps, is all the basic information on the structure of reg files. I also recommend trying to export some sections from the registry (not very large with small nesting) in order to once again look at the file structure. It never hurts. Now you can easily make changes to the registry using reg files.

REG format files open special programs. There are 2 types of REG formats, each of which opens different programs. To open desired type format, study the file descriptions and download one of the proposed programs.

How to open a REG file

Stores the registration key, serial number and other user registration information for specific program. Created upon completion of registration. It is referenced by the program when opened to identify the user, but the file should not be opened manually.

Download the program for the format

When launched, it updates the Windows Registry. Standard REG files can be created to modify various aspects of Windows. To create your own own file register updates, follow these instructions:

1. Launch Regedit (Select from the Start menu Run command, type "Regedit")

2. Select the register section you need to change

3. From the File menu, select Export

4. Select the "Selected Branch" option in the Export Range at the bottom of the window.

5. Save the file with the extension ".reg".

Note: Manually updating the Windows registry is a more advanced process and should only be attempted if you know exactly what to do. Incorrect register update may cause errors Windows operation.

How to open a REG (Registry File) file

These are small files that quietly do their job, allowing the computer to function normally and perform its tasks. If the system files are damaged, then the operating system itself begins to work with errors (“glitchy”).

In the worst case scenario, this could cause Windows to stop working completely. This does not happen often, but the reasons why the damage occurs system files some. One of them is wrong actions. Not experienced user, who, having overestimated his strength, is trying to tune the operating system, having neither knowledge nor experience.

Therefore, I want to warn you right away - if you do not know what you are doing and what consequences this may lead to - DO NOT edit system files or delete them. In principle, this applies to any files with an extension unknown to you.

Let's start looking at system files with reg file A. Because these are the files that users often encounter. Despite this unusual extension, this is actually an ordinary text file. The reg extension tells the operating system that this file contains registry keys and certain settings.

See below what the reg file looks like.

All information is clearly structured for ease of computer processing. So, for example, the mandatory first string REGEDIT With required parameter indicates to the computer which version of Windows OS the reg file is intended for. Next in in a certain order there are registry keys and parameters for them.

By the way, I have written an article using this file more than once. For example, " "

What is the reg file for?

The main purpose of this type of service files is to work with registry keys. This is the easiest way to create or replace the necessary keys. In an applied sense, a reg file is used to create, store or modify custom settings. With its help, you can quickly and easily transfer settings from one computer to another or create backup copy for the possibility of their restoration in the future.

Working with such files is quite simple. To bring in necessary information to the operating system registry, open the reg file, and click “Yes” twice - agreeing to the changes that will be made to the registry. Next, Windows will automatically create the required request, process it and enter the data into its registry.

How to work with reg file

Since, as I mentioned earlier, the reg file is essentially an ordinary text file, then the best remedy Programmers have not yet come up with a way to work with it other than notepad. Can be used standard notepad Windows or its equivalents. Based own experience, I can confidently recommend using Notepad program+++. Firstly, it is free, and secondly, it has a lot of additional features.

Editing itself is no different from working with any text. To save changes, just save the file again using the “File” - “Save As...” command or the hotkey configuration “Ctrl” + “S”.

Creating a file with the reg extension is also done using the standard procedures “File” - “Create” or the hotkey configuration “Ctrl” + “N”. In addition, you can create a reg file using standard procedure exporting data from the registry.

In conclusion, I would like to note that working with such files does not cause problems for an experienced user. I would especially emphasize “ from an experienced user" If you are just starting to master your computer, I strongly recommend that you do not experiment with the registry. Because, as practice shows, in most cases such experiments lead to the need to restore the operating system. But you will agree that you hardly need this.