List Info

Thread: Accessing the registry with Win32::TieRegistry on XP as std user not working




Accessing the registry with Win32::TieRegistry on XP as std user not working
user name
2006-04-19 22:00:43

 

I found this on Google:  listserv.activestate.com/msg34839.html">http://www.mail-archive.com/perl-win32-userslistserv.activestate.com/msg34839.html

 

 

 


From: Timothy Johnson
Sent: Wednesday, April 19, 2006 2:53 PM
To: 'Castle, Eric'; perl-win32-adminlistserv.ActiveState.com
Subject: RE: Accessing the registry with Win32::TieRegistry on XP as std user not working

 

Have you tried using the Open function instead of $Registry?  I suspect that $Registry may be using remote registry semantics to access the registry, and that may be why regular users wouldnR17;t have access.  Maybe if you use the Open function to open the key directly you might be able to access it “locallyR21;.

 


From: perl-win32-admin-bounceslistserv.ActiveState.com [mailto:perl-win32-admin-bounceslistserv.ActiveState.com] On Behalf Of Castle, Eric
Sent: Wednesday, April 19, 2006 2:02 PM
To: perl-win32-adminlistserv.ActiveState.com
Subject: Accessing the registry with Win32::TieRegistry on XP as std user not working

 

Hi,

 

In preparation for the Vista OS release, I am testing out how our perl scripts work when running as a standard user on Windows XP SP2. This user has no power user or admin permissions.

 

So far when I try to access the registry ( using Win32::TieRegistry) I get an error - the same error that I would get if the registry key did not exist. I tried using perl 5.6.1 and 5.8 and it behaves the same in both. ; If running the same script as a user with power user or admin priveldges, the scripts work fine and have no problems accessing the registry.

 

Other (non-perl) applications running as std user are able to access the registry just fine (don't know if they can alter it but they can at least read it). 

 

The registry key I was accessing was HKEY_LOCAL_MACHINE\Software\ActiveState

 

The error message I get back in $^E is:  "The system could not find the environment option that was entered".   Here is a sample script I used to test out the problem:

 

use Win32::TieRegistry;

 

my $error = "";

my $reg_key = $Registry->{"HKEY_LOCAL_MACHINE\\Software\\ActiveState\\"}
or $error = "ERROR: Can't access registry key because, $^E\n";;

print "error was \";$error\"\n";

 

Has anyone else run into this? ; I'm gonna do a search through MSDN also and see this has come up.

 

Thanks,

Eric

[1]

about | contact  Other archives ( Real Estate discussion Medical topics )