The $log is not declared, since it is irrelevant in this case.
(As I noted under the code snipset: "It's a fancy way of printing data to screen and log file").

Since it IS a code snipset: it may be that I indeed left out a 'my' declaration. The easiest way to solve this is putting in the 'my' statement or removing the 'use strict'.

The main problem is stated as comment inside the code snipset:
1. Win32::OLE->LastError() and Win32::GetLastError() return value 0 (which means success).
(which means I'm doing everything wright by coding point of view.)

2. There are no warnings thrown with the '-w' flag (in the original progam.)
(which also means that I'm doing everything wright by coding point of view.)

3. When looking at the code:
@tmpTest = $wmiService->CheckAccess($HKEY_LOCAL_MACHINE, "HKEY_CURRENT +_USER\\Console", $KEY_QUERY_VALUE, $HasAccessRight);
print "Key access rights: $HasAccessRight\n"; # Returns nothing
print "Key access rights (2): @tmpTest\n"; # Retruns 2

The first print ($HasAccessRight) should return the correct value, but it returns an empty string (actual value is 50, checked it with regedit).
(This is the main problem).
The second print (@tmpTest) returns value '2'. Normally this value should be 0 (If I read MSDN correctly), while the value 2 MIGHT indicate that I don't have permission (If I read MSDN correctly). The strange thing is, that I'm a full administrator on my Windows XP machine (in which case I should have full access to everyting).
(Which is probably a lead on what is going wrong, but I'm unable to find the issue.)

Hence, to repeat my question, Can someone help me getting StdRegProv to work with Perl?

Thanks in advance.

(p.s.: I removed all the $log objects and hopefully declared all variables to avoid any other misunderstanding).

In reply to Re^2: Windows XP: StdRegProv by jschollen
in thread Windows XP: StdRegProv by jschollen

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.