The Registry File Format

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_MACHINE\SOFTWARE\xxx123abc specifies the xxx123abc subkey below the HKEY_LOCAL_MACHINE\SOFTWARE 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.

Discuss this Article 2

Joe (not verified)
on Sep 15, 2005
This is useless

Please or Register to post comments.

Upcoming Training

Mastering System Center 2012

During over 6 hours of training you can join John Savill from your computer as he will walk you through the key components and capabilities of System Center 2012, what’s involved in using the components, and the benefit they can bring to your environment.

Register Now

Current Issue

May 2013 - The NameTranslate object is useful when you need to translate Active Directory object names between different formats, but it's awkward to use from PowerShell. Here's a PowerShell script that eliminates the awkwardness.

CURRENT ISSUE / ARCHIVE / SUBSCRIBE

Windows Forums

Get answers to questions, share tips, and engage with the Windows Community in our Forums.