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 import and export of any number of keys and values with Registry patches. Patches (.reg files) are ordinary text files that can contain anything from a single key to a dump of the entire Registry.

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

Patches have many practical uses, including creating local backups of portions of the Registry as a preventive measure before editing keys (see the preceding section). You can create a Registry key on one computer and apply it on another, which is 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 the Registry Editor, and they 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, because HKLM is enormous and you wouldn’t want to reimport it in any case.

Tip

Before making any changes to a ...

Get Windows Vista in a Nutshell 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.