Can Java launch the Windows UAC?

前端 未结 4 1026
眼角桃花
眼角桃花 2021-02-10 07:40

As the title says, I\'m wondering if it is possible for a program written in Java (and only java) to relaunch himself (preferably a .jar) with administrator privileges, s

4条回答
  •  难免孤独
    2021-02-10 07:47

    I doubt "only Java". At best you would have to have a JNI wrapper around the MSFT module. Unless just invoking the exe using ProcessBuilder counts as "only Java" -- your code to bring up the user console would be only Java but not what it invokes. IOW, Win does not come with a Java API

提交回复
热议问题