Posted on 2009-05-11 08:22:18-07 by pr1
"The system could not find the environment option that was entered"
Hello, whenever I repeatedly call Win32::TieRegistry within the same script, I get the error "The system could not find the environment option that was entered" Has anyone had this problem before? Could this be due to a buffer size entry issue in TieRegistry (see http://www.tek-tips.com/viewthread.cfm?qid=667131)? Many thanks. pr1
my $key = "\\\\$ip\\HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\SvcHost\\\ +\netsvcs"; my $services_str = "\\\\$ip\\HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Services"; my %RegHash; use Win32::TieRegistry ( Delimiter => "\\", TiedHash => \%RegHash, SplitMultis => 1, qw( REG_MULTI +_SZ KEY_READ ) ); my $Registry = \%RegHash; my $netsvcs_array_ref = $Registry->{$cle}; if ( ! defined $netsvcs_array_ref ) { warn "Could not open key '$key' on $ip: $^E.\n"; return; }
Direct Responses: Write a response
Perl Weekly newsletter
A free weekly newsletter for people who are busy to read all the blogs. click here to check it out.