> > From: perl pra <perl...@gmail.com>
> > > Can anybody help in accessing the registry of remote windows machine and
> > get
> > > the keys in the folder  *HKEY_LOCAL_MACHINE/SOFTWARE *
> > > **
> > > I have tried using win32::Registry, but i am getting the error "cannot
> > open
> > > the registry",But the same script works if i assign $node  to my local
> > Ip.
> > >
> > > Can somebody help me with the below script, so that this works for remote
> > > IPs also.
> > >
> > > please check the code below:
> > >
> > >
> > > ----------------------------------------------
> > >
> > > #!/usr/bin/perl
> > > use strict;
> > > use warnings;
> > >
> > > use Win32::Registry;
> > > my ($node) = '\\\\your_ip_here';
> > > my $Register='SOFTWARE';
> > > my ($hNode, $hKey, @key_list);
> > >
> > > $HKEY_LOCAL_MACHINE->Connect ($node, $hNode) or  die "Cannot connect to
> > > $node";

Maybe it's a permissions issue. Try to use

$HKEY_LOCAL_MACHINE->Connect ($node, $hNode)
  or die "Cannot connect to $node: $^E\n";

and let's see what will be the error message.

It works for me though I have the Win32::Registry2 patch from 
http://Jenda.Krynicky.cz installed so there maybe some reason why it 
doesn't work in the unpatched version. I don't think it's the case 
though.

Jenda

===== je...@krynicky.cz === http://Jenda.Krynicky.cz =====
When it comes to wine, women and song, wizards are allowed 
to get drunk and croon as much as they like.
        -- Terry Pratchett in Sourcery


-- 
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to