Why can't you use the Perl mod Win32::TieRegistry?

use Win32::TieRegistry ( Delimiter=>"/" );

        if ($Registry->{"//$ServerList/"}) {
                $KeyOver         =
$Registry->{"//REMOTEMACHINE/PATHTOREGISTRY"};
                $ServerRole = $KeyOver->{REGISTRYKEY};
                print  $ServerRole;
        
                ##  changes the entry
                if ($KeyOver->{REGISTRYKEY} = [$NewKeyVal,
$KeyType(DWORD,STRING, ..etc)]);
                        ##  Successful change
                } else {
                        ##  Unsuccessful change.
                }
        } else {
                exit(1);
        }

exit (0);


Jarrod Ramsey
ISD Messaging
479.277.4014
[EMAIL PROTECTED]
This e-mail is Wal-Mart confidential.


-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Monday, March 24, 2003 6:21 AM
To: [EMAIL PROTECTED]
Subject: (no subject)


Hallo All,
please help ---> which are wrong ?
I want read and write the registry into many remote computers and I can not
my own read !
----------------------------------------------------------------------------
-------------------------------------------------------
use warnings;
use strict;
$|++;
use Win32::OLE('in');
use Win32::OLE::Variant;
my $HKEY_LOCAL_MACHINE  =0x80000002; 
my @pc = ( '' ) ;
Win32::OLE->Option ('Warn' => 3);
foreach  my $server (@pc) {
        my $Locator = Win32::OLE->new('WbemScripting.SWbemLocator') or
                die "Kann Locator-Object nicht erzeugen:
".Win32::OLE->LastError()."\n";         
        $Locator->{Security_}->{impersonationLevel} = 3;

        my $Service = $Locator->ConnectServer($server,'root\default') or
                die "Kann Server-Object nicht erzeugen:
".Win32::OLE->LastError()."\n";
        my $reg = $Service->Get("StdRegProv") or
                die "Kann REg-Object nicht erzeugen:
".Win32::OLE->LastError()."\n";
        my $a = Variant (VT_ARRAY|VT_UI1,VT_EMPTY);
        my $sPath = 'HARDWARE';
        print STDOUT $reg->EnumKey("$HKEY_LOCAL_MACHINE",$sPath,$a);
# This print a 0 for ok ! ?
        print STDOUT '*' x 80,"\n",$a;
# This print nothing (only 80 x *)
        print STDOUT '*' x 80,"\n",@$a->Get;
# This print nothing (only 80 x *)
}
----------------------------------------------------------------------------
----------------------------------------------------------------------------
----------------
Mit freundlichen Gr�ssen 
Joachim G�rner

Information Technology Systemintegration (ITS)
ADAC e.V., Am Westpark 8, 81373 M�nchen
Tel.: (089) 76 76 27 83 Fax: (089) 76 76 34 22
mailto:[EMAIL PROTECTED]
www.adac.de

_______________________________________________
Perl-Win32-Admin mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


**********************************************************************
This email and any files transmitted with it are confidential
and intended solely for the individual or entity to 
whom they are addressed.  If you have received this email
in error destroy it immediately.
**********************************************************************
             Wal-Mart Stores, Inc. Confidential
**********************************************************************

_______________________________________________
Perl-Win32-Admin mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to