in reply to win32::TieRegistry script

Use any of the serialization modules, preferably one that outputs text. For example, I've done this with Data::Dumper (for non-huge registry keys). It recording the bless state was a pain but easy enough to remove. Then just assign the reconstituted hash in order to reconstruct the whole Registry tree.

Update: You can also use TieRegistry to load and modify the information in the hive before you restore it (or use regedt32 to do this).

- tye        

  • Comment on Re: win32::TieRegistry script (serialize)

Replies are listed 'Best First'.
Re^2: win32::TieRegistry script (serialize)
by tachyon (Chancellor) on Jun 11, 2004 at 04:48 UTC

    All you really need is the (somewhat undocumented) /e flag on REGEDIT and it will dump the hive for you in native *.REG format ready for reimport.

    C:\>regedit /e active.reg HKEY_LOCAL_MACHINE\SOFTWARE\ActiveState C:\>type active.reg Windows Registry Editor Version 5.00 [HKEY_LOCAL_MACHINE\SOFTWARE\ActiveState] [HKEY_LOCAL_MACHINE\SOFTWARE\ActiveState\ActivePerl] "CurrentVersion"="635" [HKEY_LOCAL_MACHINE\SOFTWARE\ActiveState\ActivePerl\635] @="D:\\Perl\\" [HKEY_LOCAL_MACHINE\SOFTWARE\ActiveState\ActivePerl\635\Help] @="D:\\Perl\\html\\index.html" [HKEY_LOCAL_MACHINE\SOFTWARE\ActiveState\PerlScript] [HKEY_LOCAL_MACHINE\SOFTWARE\ActiveState\PerlScript\1.0] "NoCaseCompare"=dword:00000001 "EnabledZones"=dword:00000010 "EnableEventLogMsgs"=dword:00000000 C:\>

    cheers

    tachyon

      thanks tachyon! that worked nicely.