From: Steve <[EMAIL PROTECTED]> > I am not sure what the best way to tackle this problem so here it > goes... > > I want to use the user's input to replace a string value in the > registry. The problem is locating the subkey. There is one location > that I need to change the string value: > > \\HKLM\SOFTWARE\Funk Software, Inc.\odyssey\client\configuration > \userDefaults\profiles\profile#1A1A1AAAAA11111AAAA1AA1A1A1A1A1A1AAA111 > 1 \authentication > > ttlsIdentity: UserName > > Under the "profiles" key, there are two "profile#..." subkeys. There > are exactly 40 alphanumerics following the "#". > > Under both "authentication" keys, they both contain the "ttlsIdentity" > string value. If I have to make both the same values, that's fine as > long as I change the second "ttlsIdentity" value to the username the > user input in the script. > > What differetiates the two profile keys are that they contain > different string values for secondaryAuth in subkey "authentication."
If you install the Win32::Registry2 patch from http://Jenda.Krynicky.cz/#Win32::Registry2 you may do something like this: use Win32::Registry; ... my $key = $HKLM->Open('SOFTWARE\Funk Software, Inc.\odyssey\client\configuration\userDefaults\profiles'); foreach my $subkey ($key->GetKeys()) { next unless my $subkey = $key->Open("$subkey\\authentication"); next unless $subkey->GetValue('secondaryAuth') eq 'PAP-Token' $subkey->SetValue('ttlsIdentity', REG_SZ, $username) } Jenda P.S.: The code is untested, but should be about right. ===== [EMAIL PROTECTED] === 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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>