Lili has asked for the wisdom of the Perl Monks concerning the following question:

Can someone help me on this? I need to export some registry keys from one machine and put them into one file which is located in different machine. This file will be used to manually load the registry

Replies are listed 'Best First'.
Re: Export registry from different server
by particle (Vicar) on Jan 25, 2002 at 00:12 UTC
    a coding solution would most likely involve either Tie::Registry or Win32::Registry. the latter is included in the ActiveState distribution. and Super Search might help you find previous solutions or related posts here.

    ~Particle

Re: Export registry from different server
by hopes (Friar) on Jan 25, 2002 at 05:31 UTC
    Hello, I use Win32::TieRegistry 'cause Win32::Registry is obsolete
    (and I haven't save registry from remote machines)
    To connect to a remote machine:
    $remMachKey= $Registry->Connect( "HostA", "LMachine", {Delimiter->"/"} + ) or die "Can't connect to HostA's HKEY_LOCAL_MACHINE key: $^E\n" +;
    To save a key:
    $pound= $Registry->Delimiter("/"); $diskKey= $Registry->{"LMachine/Software/Fermin"} or die "Can't read LMachine/ key: $^E\n"; $diskKey->AllowSave( 1 ); $diskKey->RegSaveKey( "registro", [] );
    Hope this helps

    Hopes
    $_=$,=q,\,@4O,,s,^$,$\,,s,s,^,b9,s, $_^=q,$\^-]!,,print
Re: Export registry from different server
by screamingeagle (Curate) on Jan 24, 2002 at 23:52 UTC
    Hi, Open the registry (Start->Run->regedit), expand the registry tree and click on the node you want to export; then go to File->Export Registry File. In the "Export Range" section , choose "Selected Branch" (the value for this section should be the path upto the selected node), then "Save". The file will be saved as a .REG file.Copy the REG file over to the target machine.You can import the keys in 2 ways
    1) Open the registry in the target machine and choose File->Import Registry File, and choose the REG file you created
    2) Or, you can double-click on the REG file, and it will insert the values in the appropriate places in the registry of the target machine.
    hope this helps... :)
      Thank you very much! Actually I was looking for how to do it in coding. I am not sure I should use the "Export" or "Save" statement to work it out.
Re: Export registry from different server
by ralphie (Friar) on Jan 25, 2002 at 18:09 UTC
    if you're doing much of this type of thing, i highly recommend dave roth's win32 perl scripting reviewed here. you might also want to consider mr. roth's other book win32 perl programming: the standard extensions. a newer edition of the latter was released in september, and though it is a little spicy at $50 it is a valuable reference.

    speaking of which, does anyone know what happened at fatbrain? i checked the prices for these books just now and both are listed as full list price. i know they gotta make a buck, and i wouldn't have minded splitting the difference, but full list price gives me a little sticker shock.