The Registry File Format

Here’s a look at the format of the entries in a registry file.

Ethan Wilansky

November 24, 2003

1 Min Read
ITPro Today logo in a gray background | ITPro Today

A registry (.reg) file is a text file that contains registry key paths, value names, and values. The key paths always begin with one of the five root key names: HKEY_CLASSES_ROOT, HKEY_CURRENT_USER, HKEY_LOCAL_MACHINE, HKEY_USERS, or HKEY_CURRENT_CONFIG. The root key names designate the beginning location in the registry to update. For example, HKEY_LOCAL_MACHINESOFTWARExxx123abc specifies the xxx123abc subkey below the HKEY_LOCAL_MACHINESOFTWARE path. Below the key path in the registry file are value names and value pairs, collectively referred to as a registry entry. The registry can write any of the following data types for each registry entry: String, Binary, DWORD, Expandable String, or Multi-String. As Table A shows, in the registry file, the registry entries should consist of the following elements, with no spaces between those elements:

  • The data type and the specified number enclosed in quotation marks. (The number never changes.) For the String data type, you don't include a number.

  • An equals sign (=).

  • A text prefix.

  • A colon (:). For the String data type, you don't include a colon.

  • The actual value. For the String data type, you must enclose the string in quotation marks.

Sign up for the ITPro Today newsletter
Stay on top of the IT universe with commentary, news analysis, how-to's, and tips delivered to your inbox daily.

You May Also Like