How to write a reg file. How to create the registry file yourself.reg. How to create a registry file. Go…

Files with the extension reg needed to quickly make changes to the Windows registry (a kind of system-wide set of settings, configurations and parameters). For example, you can quickly remove the trash can from the desktop or disable the Caps Lock key (for example, it bothers me).
1. To create a file with the extension .reg, right-click on an empty area of ​​the folder or desktop, point to the “New” group and select “Text Document”.
2. You will be offered a standard name, something like "Text document.txt". Enter the required name for the new file, for example, for the already mentioned article “How to disable the recycle bin and remove it from the desktop,” create a file with the name korzina.reg.
3. Confirm the extension change.

4. That’s it, a new file with the .reg extension has been successfully created.
5. To add commands and parameters to it, right-click on it and select edit.

6. The editor will open. Make the necessary changes and save the file by pressing Ctrl+S or select the "File" menu in the top panel, then the "Save" command.

7. To make changes to the registry, double-click our reg file, or right-click on it and select the first item “Merge”. Agree with the warning about changes to the registry.

So, how to create a file with the extension . reg?

Let's look at everything in order. First, we need to make sure that in Windows XP/Vista/7/8 the function for hiding extensions of registered file types is disabled. Next we will show you how to do this (see below):

1) Click Start and choose Control Panel

2) In the window that appears, select Design and personalization(after setting in the line View: category)

If you have set the parameter large or small icons:

then we're just looking Folders settings Let's go straight to point 4.

4) You will see this window:

Go to the tab View, scroll the list to the very end and look for the line Hide extensions for registered file types, and uncheck the box.

Click OK and close all previous windows. Now we see file extensions. For example, a text document will have the extension .txt at the very end of its name.

5) Now let's start creating reg file

Right-click on the desktop (or any folder)

select in the context menu Create ---> Text Document

REG format files can be opened with special programs. There are 2 types of REG formats, each of which is opened by different programs. To open the desired type of 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 a 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 REG format

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

1. Run Regedit (Select Run from the Start menu, 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. Incorrectly updating the registry can cause Windows errors.

How to open a REG (Registry File) file

This article outlines the basic principles of working with the Windows registry, knowledge of which will be useful to you in customizing the operating system using registry tweaks.

Terminology

Before getting down to business, you need to define the terminology. I'm using official Microsoft terminology, so the terms are fairly 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

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

REG file format

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

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

Creating a REG file

Creating a REG file is very simple. Copy the code into any text editor (for example, 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 the Windows 98 / NT 4.0 format, which, however, will also be understood by newer Windows operating 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 the operating system GUI, 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 the system registry - this operation is called importing registry settings.

Exporting registry settings

Exporting registry settings is an easy task. As a rule, settings are exported before making changes 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, you do not need to specify the full path to run it on the command line (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 the command from the context menu 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. You can paste a copied registry key (from an article or from a forum post) into the address bar and quickly navigate to the desired setting. 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 launching a REG file containing the necessary parameters by double-clicking or from the command line.

Double click

Command line

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 a silent system installation. But there are other ways.

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 you double click. 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 You can also import registry settings. It is convenient because the commands for importing parameters can be included in a batch file that 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 REGEDIT /S C:\hklm.reg.

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 .

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 has been blocked (you can read how to do this in the article), then the easiest way to edit the registry is to create and import a reg file (of course, you can go into DOS, into protected mode, use other programs, but that’s all much more difficult, 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. There MUST be an empty line after this text. 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 as a regular program, you will be prompted to make changes to the registry, and after a positive answer, 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. indicates that this will be a binary parameter, followed by 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 @ sign 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 Windows shell settings, 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.