> I am currently testing code to modify a remote NT Workstation's Registry
> value (AutoShareWks). At this point, I just have Perl trying to print out
> the value, but am getting the following error message. If I can get this
> to work, I will then set the value to 1 to turn on "Create hidden drive
> shares (workstation)" on 73 workstations which were deployed incorrectly.
> Any help interpreting it would be appreciated. The code is a combination
> of examples 3.16 and 3.21 from Roth's Std Extensions book.
>
Error Message:
> Variable "$HKEY_LOCAL_MACHINE" is not imported at line XX
> (Did you mean &HKEY_LOCAL_MACHINE instead?)
> Global symbol "$HKEY_LOCAL_MACHINE" requires explicit package name at line
> XX
>
> ####################################################################
>
use Win32::Registry;
> $Machine = "\\\\NT_WORKSTATION1";
> $KeyName =
> "System\\CurrentControlSet\\Services\\LanmanServer\\Parameters";
> $ValueName = "AutoShareWks";
>
> if ($HKEY_LOCAL_MACHINE->Connect($Machine, $Root)) { # This is line XX
> if ($Root->Open($KeyName, $Key)) {
> if ($Key->QueryValueEx($ValueName, $DataType, $Data)) {
> if ( REG_DWORD == $DataType ) {
> print "Value of AutoShareWks = $Data\n";
> ## $Data = 1;
> ## $Key->SetValueEx($ValueName, 0, $DataType, $Data);
> }
> }
> }
> }
>
>
_______________________________________________
Perl-Win32-Admin mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-admin