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

Hi!

I have problems while loading a hive file in a remote registry. Please have a look:

First I save the key in a hive on a local host:

my $key= new Win32::TieRegistry "LMachine/Software/Kerridge/KPrint/Que +ues/", { Delimiter=>"/" }; my $success= $key->AllowSave(1); $key->RegSaveKey( "KPrintQueues_new.hive", [] );

Then I will load the key from that hive file into the registry on a remote host:

my $remotepks = $Registry->Connect ( "$zielserver", "LMachine/Software +/Kerridge/KPrint/", { Delimiter=>"/" } ); my $allowload2 = $remotepks->AllowLoad( 1 ); my $loadkey2 = $remotepks->Load( "KPrintQueues_new.hive", "Queues" ); $remotepks->{"LMachine/Software/Kerridge/KPrint/Queues"}=$loadkey2;

I have tested the hive file while loading this hive on my local host = ok.

But while loading this hive on a remote host I have noticed, that the key will appear for a short time under HKLM und will be unloaded after the script has finished (I stopped the script via
system("pause"); at the end on the above snippet).

Do you have any idea??
Many thanks!!

Carsten

20040629 Edit by Corion: Added code tags

Replies are listed 'Best First'.
Re: TieRegistry: Load a hive on a remote host (look)
by tye (Sage) on Jun 30, 2004 at 02:41 UTC
    Do you have any idea??

    Read the docs?

    The hive is automatically unloaded when the returned object is destroyed.

    Search or Super Search? TieRegistry Load finds a recent node on this that suggests using

    $key->RegLoadKey( $subKey, $file )

    of Win32API::Registry which can be used with TieRegistry objects.

    - tye        

      Tye!

      Thanks for that hint!

      Carsten