That did the trick.  Thanks

M- 

-----Original Message-----
From: Adam R. Frielink [mailto:[EMAIL PROTECTED] 
Sent: Thursday, October 28, 2004 10:42 AM
To: MJG; [EMAIL PROTECTED]
Subject: RE: SID Collection

 

> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On Behalf 
> Of MJG
> Sent: Thursday, October 28, 2004 10:33 AM
> To: [EMAIL PROTECTED]
> Subject: RE: SID Collection
> 
> Trying to use a simple setup for TieRegistry.  Although it is readying

> the keys, can't get it to write.
> 
> Any ideas?
> 
> Thanks
> 
> M-
> 
> use strict;
> use Win32 ();
> use Win32::TieRegistry 0.20 ( Delimiter=>"#", ArrayValues=>0 );
> 
> my $pound= $Registry->Delimiter("/");
> 
> my $UserEnv = $ENV{"USERNAME"};
> 
> my $RegVal1 = "*Information";
> my $KeyVal1 = "PreferredServer";
> my $RegVal2 = "00000008";
> my $KeyVal2 = "PrintOption";
> my $tempSID = "S-1-5-21-842925246-1343024091-839522115-1003";
> My %Key;
> #------------------------------
> 
> $Key =
> $Registry->{"LMachine/System/CurrentControlSet/Services/NWCWor
> kstation/Parameters/Option/".$tempSID}
>  ||  die "Can't read
> LMachine/System/CurrentControlSet/Services/NWCWorkstation/Para
> meters/Opt
> ion/ key: $^E\n";
> 
> # Add key and value Regardless
> $Key->{$KeyVal1 => [ $RegVal1, "REG_SZ" ] };
> $Key->{$KeyVal2 => [ $RegVal2, "REG_DWORD" ] };

Try something like this.  It will create the $tempSID if it doesn't
exist, and set the key values.

    $Registry->Delimiter("/");                  # Set delimiter to "/".

 
$Registry->{"LMachine/System/CurrentControlSet/Services/NWCWorkstation/P
arameters/Option/"} = {
        "$tempSID/" => {
            "/$KeyVal1" => [ $RegVal1, "REG_SZ" ],
            "/$KeyVal2" => [ $RegVal2, "REG_DWORD" ],
        },
    }; 



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

Reply via email to