如何从Java提升我的UAC权限? [英] How do I elevate my UAC permissions from Java?

查看:637
本文介绍了如何从Java提升我的UAC权限?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要使用Preferences API的systemRoot功能,但如果启用了UAC,则由于Windows上缺少权限而失败。我正在尝试查找弹出UAC提示的技术细节,并提升我的权限以允许systemRoot更新成功。

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 popping the UAC prompt and elevating my permissions to allow the systemRoot updates to succeed.

推荐答案

根据此SO问题的接受答案,您无法更改正在运行的进程的UAC权限。

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:


  • 创建一个包装器来启动JVM(带有适当的参数!)使用请求提升权限的Windows清单,或

  • 使用链接到第二个答案的应用程序以提升的权限运行JVM。

这篇关于如何从Java提升我的UAC权限?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆