How do I elevate my UAC permissions from Java?

后端 未结 3 2025

I need to use the systemRoot feature of the Preferences API, but it fails due to lack of permissions on Windows if UAC is on. I\'m trying to find the technical details of p

3条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-11-27 21:44

    According the accepted answer to this SO question, you cannot change the UAC permissions of a running process.

    According to the answers to this SO question, possible ways to launch a process with elevated permissions are:

    • create a wrapper to launch the JVM (with the appropriate arguments!) with a windows manifest that requests raised privileges, or
    • use the application linked to the 2nd answer to run the JVM with raised privileges.

提交回复
热议问题