Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Windows Registry
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
=== <code>.REG</code> files === <code>.REG</code> files (also known as Registration entries) are text-based human-readable files for exporting and importing portions of the registry using an [[INI file|INI]]-based syntax. On Windows 2000 and later, they contain the string ''Windows Registry Editor Version 5.00'' at the beginning, while on [[Windows 9x]] and NT 4.0 systems, they contain the string ''REGEDIT4''.<ref name="Regfiles">{{Cite web|url=https://support.microsoft.com/en-us/help/310516/how-to-add-modify-or-delete-registry-subkeys-and-values-by-using-a-reg|title=How to add, modify, or delete registry subkeys and values by using a .reg file|website=support.microsoft.com}}</ref> Windows 2000 and later REG files are [[Unicode]]-based, while on [[Windows 9x]] and NT 4.0 systems, they are [[Windows code page|ANSI]]-based. {{citation needed| date=December 2023}} Windows 9x format <code>.REG</code> files are compatible with Windows 2000 and later.<ref name="Regfiles" /> The Registry Editor on Windows on these systems also supports exporting <code>.REG</code> files in Windows 9x/NT format.{{citation needed| date=December 2023}} Data is stored in <code>.REG</code> files using the following syntax:<ref name="Regfiles" /> <syntaxhighlight lang="registry"> [<Hive name>\<Key name>\<Subkey name>] "Value name"=<Value type>:<Value data> </syntaxhighlight> The Default Value of a key can be edited by using {{code|@}} instead of "Value Name": <syntaxhighlight lang="registry"> [<Hive name>\<Key name>\<Subkey name>] @=<Value type>:<Value data> </syntaxhighlight> String values do not require a <Value type> (see example), but [[Escape (Programming)|backslashes]] ({{code|\}}) need to be written as a double-backslash ({{code|\\}}), and quotes ({{code|"}}) as backslash-quote ({{code|\"}}). For example, to add the values "Value A", "Value B", "Value C", "Value D", "Value E", "Value F", "Value G", "Value H", "Value I", "Value J", "Value K", "Value L", and "Value M" to the {{code|HKLM\SOFTWARE\Foobar}} key: <syntaxhighlight lang="registry"> Windows Registry Editor Version 5.00 [HKEY_LOCAL_MACHINE\SOFTWARE\Foobar] "Value A"="<String value data with escape characters>" "Value B"=hex:<Binary data (as comma-delimited list of hexadecimal values)> "Value C"=dword:<DWORD value integer> "Value D"=hex(0):<REG_NONE (as comma-delimited list of hexadecimal values)> "Value E"=hex(1):<REG_SZ (as comma-delimited list of hexadecimal values representing a UTF-16LE NUL-terminated string)> "Value F"=hex(2):<Expandable string value data (as comma-delimited list of hexadecimal values representing a UTF-16LE NUL-terminated string)> "Value G"=hex(3):<Binary data (as comma-delimited list of hexadecimal values)> ; equal to "Value B" "Value H"=hex(4):<DWORD value (as comma-delimited list of 4 hexadecimal values, in little endian byte order)> "Value I"=hex(5):<DWORD value (as comma-delimited list of 4 hexadecimal values, in big endian byte order)> "Value J"=hex(7):<Multi-string value data (as comma-delimited list of hexadecimal values representing UTF-16LE NUL-terminated strings)> "Value K"=hex(8):<REG_RESOURCE_LIST (as comma-delimited list of hexadecimal values)> "Value L"=hex(a):<REG_RESOURCE_REQUIREMENTS_LIST (as comma-delimited list of hexadecimal values)> "Value M"=hex(b):<QWORD value (as comma-delimited list of 8 hexadecimal values, in little endian byte order)> </syntaxhighlight> Data from <code>.REG</code> files can be added/merged with the registry by double-clicking these files or using the /s switch in the command line. <code>REG</code> files can also be used to remove registry data. To remove a key (and all subkeys, values and data), the key name must be preceded by a minus sign ({{code|-}}).<ref name="Regfiles" /> For example, to remove the {{code|HKLM\SOFTWARE\Foobar}} key (and all subkeys, values and data), <syntaxhighlight lang="registry"> [-HKEY_LOCAL_MACHINE\SOFTWARE\Foobar] </syntaxhighlight> To remove a value (and its data), the values to be removed must have a minus sign ({{code|-}}) after the equal sign (<code>=</code>).<ref name="Regfiles" /> For example, to remove only the "Value A" and "Value B" values (and their data) from the {{code|HKLM\SOFTWARE\Foobar}} key: <syntaxhighlight lang="registry"> [HKEY_LOCAL_MACHINE\SOFTWARE\Foobar] "Value A"=- "Value B"=- </syntaxhighlight> To remove only the Default value of the key {{code|HKLM\SOFTWARE\Foobar}} (and its data): <syntaxhighlight lang="registry"> [HKEY_LOCAL_MACHINE\SOFTWARE\Foobar] @=- </syntaxhighlight> Lines beginning with a semicolon are considered comments: <syntaxhighlight lang="registry"> ; This is a comment. This can be placed in any part of a .reg file [HKEY_LOCAL_MACHINE\SOFTWARE\Foobar] "Value"="Example string" </syntaxhighlight>
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)