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        


In reply to Re: Win32::TieRegistry and Vista (stabs) by tye
in thread Win32::TieRegistry and Vista by Shade

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.