Java Administrator Rights (UAC)

My application consists of server a and a client interface. I want the client to be able to request a server to write a registry key. Now I have done my research on the libraries for java that did this, and I found a few. The problem is administrator rights. When I run a simple java program to read from the registry, I get an error message that tells me that I do not have sufficient rights. I assume this is due to UAC in Vista and 7, but the same problem occurs when starting a program from Windows XP.

Is there a way to run my server program with elevated privileges so that when a client requests a registry update, the server runs it without problems? (right click as admin is not an option, I'm afraid)

EDIT:

Actually my question boils down to whether there is a way to run the jar file as an executable file with higher permissions. I mean something simple that should be available?

+3
source share
2 answers

I found a "hacker" solution to this problem. I create a shortcut for the java.exe program, change its purpose to pass the parameters that start my jar, and then just mark "Run as administrator". But I still think that there should be an option for launching with increased rights to banks ...

0
source

There is always a runas command .

0
source

Source: https://habr.com/ru/post/1728928/


All Articles