in reply to Win32::TieRegistry - RegSaveKey saves on remote hosts disk but not mine.

The Win32::TieRegistry docs mention that "The $file path is interpreted relative to %SystemRoot%/System32/config on the machine where $key resides". Assuming the remote machine has write access to your machine, I imagine that replacing "c:\\" with "\\NAME_OF_YOUR_MACHINE\some\writable\path" would work (though you'd probably have to fiddle with the number of slashes - am not on a Windows box to be able to check).

Assuming that you can use UNC paths, then LoadKey should work in the same manner. Hope that helps

  • Comment on Re: Win32::TieRegistry - RegSaveKey saves on remote hosts disk but not mine.

Replies are listed 'Best First'.
Re^2: Win32::TieRegistry - RegSaveKey saves on remote hosts disk but not mine.
by Sioln (Sexton) on Jan 20, 2006 at 14:23 UTC
    $REMOTE->{$key_to_save}->RegSaveKey( "//127.0.0.1/C$/sioln1.reg", [] ) + or die $^E;
    dead: Network path not found :(
    $REMOTE->{$key_to_save}->RegSaveKey( "\\\\127.0.0.1\\C\$\\sioln1.reg", + [] ) or die $^E;
    Creates on remote host :(

      127.0.0.1 may well be being interpreted as the remote machine, not yours - what happens if you explicitly use either your machine's name, or a non-127.* address?

      Update:

      Further poking around reveals that RegSaveKey and RegLoadKey are defined in Win32API::Registry, which mentions the following:

      WARNING:  Loading of hive files via a network share may silently
      corrupt the hive and so should not be attempted (this is a problem
      in at least some versions of the underlying API which this module
      does not try to fix or avoid).  To access a hive file located on a
      remote computer, connect to the remote computer's Registry and load
      the hive via that.

      Which seems to imply that it is possible to do this remotely.

        I'm idiot :)
        Thanks.