Introduction
A .reg file is a text listing of keys and values from the
Windows Registry, the database where
Windows and its programs keep their settings. Registry Editor writes one when a key is
exported, and opening a .reg file merges its contents back into the
Registry, after a warning.
Because merging a file can change any setting on the machine, .reg files
from unknown sources should be read before they are opened. The Registry itself is
stored in binary hive files, which are a different format.
Structure
Files written by current versions of Registry Editor are UTF-16 text and start with
the line Windows Registry Editor Version 5.00. Older files start with
REGEDIT4 and use the ANSI code page.
Each key appears as its full path in square brackets, followed by its values, one per
line. A value is a quoted name, or @ for the key’s default value, an equals
sign and the data: a quoted string, dword: and eight hexadecimal digits, or
hex: and a list of bytes. Other types are written as
hex(type):, such as hex(2): for an
expandable string and hex(7): for a list of strings. A value of
- deletes the value, and a minus sign before a key’s path,
[-HKEY_…], deletes the whole key.
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Software\Example]
"Name"="Text value"
"Count"=dword:00000010
"Old"=-
Links
Software
- Registry Editor (regedit), built into Windows, which exports and merges .reg files
- reg, the command line tool built into Windows, whose
reg exportandreg importcommands write and read them - Any text editor, such as Notepad