1

I'm trying to get the Windows ProductId from HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion but it returns null, but ProductName does return the correct value. I am thinking Windows has some kind of protection or that it's not being ran as an administrator?

If the latter, can someone tell me how to run my application with administrative privileges IN Java ?

I don't need suggestions like 'use this program to get the key', please just answer my question.

Thanks in advance,

Rick.

dvhh
  • 4,724
  • 27
  • 33
  • 1
    `I don't need suggestions like 'use this program to get the key', please just answer my question` -- Are we now adding constraints when asking for free advice? – Hovercraft Full Of Eels Apr 21 '12 at 16:49
  • No, I appreciate it if someone were to answer my question but I've posted this question on a few sites and every single time I've gotten such response. Sorry. – user1348569 Apr 21 '12 at 16:56
  • hello, try this http://stackoverflow.com/questions/6304275/c-sharp-reading-the-registry-productid-returns-null-in-x86-targeted-app-any-c – PresleyDias Apr 23 '12 at 04:43
  • possible duplicate of [Detect if Java application was run as a Windows admin](http://stackoverflow.com/questions/4350356/detect-if-java-application-was-run-as-a-windows-admin) – dvhh Mar 27 '15 at 03:19

1 Answers1

0

You cannot do it with a Jar for some security reasons.

Even if you use a Jar for launch another script in VBS, your VBS script haven't enough of system right for read the Windows registry binary keys.

Tarlna
  • 1
  • 1