Hi,
I am editing default user's profile NTUSER.DAT with TieRegistry.
All seems to work, and the registry gets unloaded (at least the change
gets saved) but I cannot work out why I get this error message:
"Couldn't unload /Users/NTUSER/: The parameter is incorrect."
...where Users is HKEY_USERS of course, and NTUSER is the second
parameter to the load method.
The unload method returns a scalar value of 1.
I'm at a loss, any suggestions?
Regards, Paul
-=-=-=-=-=-=-=-=-=-=-=-=-=-
Here is my code snippet:
use Win32::TieRegistry (Delimiter=>"/", AllowLoad => 1, AllowSave => 1,
qw(KEY_READ KEY_WRITE KEY_ALL_ACCESS));
$Users = $Registry->{"Users/"};
if ($MyProfile = $Users->Load("C:\\Winnt\\Profiles\\Default
User\\NTUSER.DAT", "NTUSER", {Access=>KEY_ALL_ACCESS})) {
print "Key loaded ok\n";
} else {
die "Unable to load key\n";
}
if (! ($MyProfile->
{"Software/Microsoft/Windows/CurrentVersion/Policies/"} = { "System/" =>
{ "/NoDispScrSavPage" => [ pack("L",1), "REG_DWORD" ] } })) {
print "Some kind of error editing registry!\n";
}
# $MyProfile->UnLoad || print "Unable to unload key from registry\n";
$ result = $MyProfile->UnLoad;
print "Result: $result\n";
---------------------------- ERG Group --------------------------
The contents of this email and any attachments are confidential
and may only be read by the intended recipient.
-----------------------------------------------------------------
_______________________________________________
Perl-Win32-Admin mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-admin