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 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access