![]() |
![]() ![]() |
5.6 Saving and Loading Registry KeysRegEdt32 allows you to dump Registry data into ordinary files that you can back up or use on other machines. You can save data in binary and text formats, and you can reload binary data when you need it again. The text format has the advantage of being human-readable, but the binary format is more efficient and is the only one RegEdt32 can import. (For more details on using this capability to back up your Registry, see Chapter 3.) RegEdt32 normally deals with the hive files stored in %systemroot%\system32\Config. However, you can also create your own files that contain just the keys and values you want. Once you've created such a file, you can load it back to its original location or anywhere else in the Registry. You can also use the file on another machine's Registry. 5.6.1 Saving KeysTo create a binary file of Registry data, just select the key or
subkey you want to save, then use
RegEdt32's Registry There's no way to combine more than one key in a file unless they have a common parent. If you want to capture web browser settings from your local machine, you could save HKLM\Software\Microsoft and HKLM\Software\Netscape in two separate files, or you could save HKLM\Software and get them both--plus a lot of other unrelated stuff. 5.6.2 Restoring KeysOnce you've saved a key, restoring it is fairly
straightforward. Select the location where you want the key to appear
when loaded, then use the Registry When the new key is loaded, it actually replaces allsubkeys and values of the selected key. Before anything actually gets replaced, you'll see a warning dialog asking you to confirm that you want to wipe out all the existing subkeys and values of the selected key. Unfortunately, though, the dialog doesn't tell you which key is about to be affected, so make sure you double-check the selected key to ensure it's the one you meant to restore over. 5.6.3 Loading Saved Keys as HivesWhen you load a key with Registry You may load a saved key as a hive under HKU or HKLM but not any
other root key. If you have HKU or HKLM selected,
RegEdt32 enables the Registry Once a saved key is loaded as a hive, you can modify its keys and
values like any other key. The changes are reflected in the saved key
file, which remains loaded and available until you explicitly unload
it with the Registry 5.6.4 Saving as TextRegEdt32 also allows you to save a key
and its values to a text file with the Registry 5.6.5 Providing an Improvised ClipboardThere's one major feature that RegEdt32 and RegEdit both lack: a real set of Clipboard operations. It would really be handy to be able to copy a Registry key from one location and paste it in another, especially since both programs let you open the Registries of other machines on the network. While RegEdt32 doesn't directly provide
Clipboard support, you can get the same effect with the
Registry
5.6.6 A True StoryNow it's time for an anecdote. While writing this chapter, I ran into a problem. The shareware screen capture software I use to grab figures for my writing (the excellent SnagIt/32 from TechSmith; http://www.techsmith.com/) is installed under my account on a machine named enigma. When I'm logged on to that machine, SnagIt can find its registration key and settings data in HKCU\Software\TechSmith\SnagIt\Settings, and it's happy. However, for some of the figures, I needed to log into a different domain, and since I wasn't logged in as the same user, SnagIt could no longer see its settings data. To make things worse, I couldn't find the piece of paper with my registration code, and I was in a hurry. Solution: use RegEdt32. I logged onto
enigma, saved the SnagIt settings key by
selecting HKCU\Software\TechSmith\SnagIt\Settings and using the
Registry |
![]() |
![]() ![]() |