in reply to Win32::TieRegistry and Vista
My first guess would be that you aren't using $^E fast enough and its value is getting overwritten before you report it. This can happen quite quickly. However, if your code is exactly as written, then you are copying the string value of $^E to be part of the string you pass to croak() very quickly, so that seems unlikely. Just in case the unlikely isn't impossible, you might instead add the following code and replace your use of $^E with regLastError():
use Win32API::Registry qw( regLastError KEY_READ );
(which also means that you can use KEY_READ() without having to prepend the lengthy Win32::TieRegistry:: to it.) regLastError() doesn't get overwritten by random Perl actions unlike $^E does.
More likely, Vista disables remote access to the Registry. Can you remotely access the Registry from regedt32/regedit ? I have vague memories of having to turn on this access but I don't recall the details at this time. Hmm, actually that was probably for an old system... but I wouldn't be surprised if something similar were required for Vista as MicroSoft has been disabling a growing number of features in the name of security. This is supported by this item turned up by google: http://www.tabletquestions.com/windows-vista/10066-unable-access-hklm-registry-key-remotely.html
Just to throw out some other ideas that occurred to me but that likely aren't the problem...
Another consideration is the credentials used to connect to the system. Using a command like "net use \\pcname /user:domain\username *" (enter your password when prompted) before running your script can resolve some security issues, especially if you have a more privileged login for use on that machine than the one you are currently using.
I'd also consider looking at the "advanced" privileges associated with your username on that system. I rather expect that Vista doesn't give admins access to remotely access the registry by default. The tools used to control these individual privleges have been shifting so I doubt what works in Vista is what I've used (and I'd have to go look up what I use anyway). But I'd expect that this problem would give a cleared "permission denied" type of error reason.
- tye
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Win32::TieRegistry and Vista (stabs)
by Shade (Novice) on Jan 23, 2007 at 18:51 UTC |