Exporting and Importing Registry Data with Patches

Hives have an arcane format, making direct editing all but futile. Fortunately, the Registry Editor conveniently supports the importing and exporting of any number of keys and values with Registry patches. Patches (.reg files) are ordinary ASCII text files that can contain anything from a single key to a dump of the entire Registry.

Registry patches can be created with Registry Editor or a standard text editor, such as Notepad. You can also use Notepad to view and modify patches, and then use Registry Editor to reimport the patch.

Patches have many practical uses, including creating local backups of portions of the Registry as a preventative measure before editing keys (see the previous section). You can create a Registry key on one computer and apply it on another, useful for migrating a single setting or a whole group of settings to any number of Windows systems. Patches can allow easier editing than with Registry Editor, and certainly afford quicker and more flexible searches.

To create a Registry patch, highlight the key you want to export and select File Export. Once you’ve chosen a filename, the selected key, any subkeys, and all their values and respective data will be saved in a single file with the .reg extension. In most cases, you wouldn’t want to select My Computer to export the entire Registry, since, for no other reason, HKLM is enormous and you wouldn’t want to reimport it in any case.

Tip

Before making any changes ...

Get Windows XP in a Nutshell, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.