Java:以管理员身份运行 [英] Java: run as administrator
问题描述
Java中是否有办法要求系统控制管理员功能。
当然没有这样做:右键单击exe - >以管理员身份运行。
我想要的是来自UAC的框架,如Windows Vista或Windows 7。
Is there a way in Java to ask the system to get control over administrator functionality.
Of course without doing: Right click on the exe -> run as admin.
What I want is that there comes a frame from UAC like in Windows Vista or Windows 7.
或者我从jar中制作exe时要做一些设置吗?
Or have I to do some settings while making an exe from the jar?
推荐答案
您必须创建一个清单文件,指定您的应用程序需要管理员权限。您可以在您的exe中包含清单或将其保存为单独的文件(yourapp.exe.manifest)
You have to create a manifest file that specifies that your application needs administrator permissions. You can include the manifest in your exe or keep it as a separate file (yourapp.exe.manifest)
http://msdn.microsoft.com/en-us/library/bb756929.aspx
这篇关于Java:以管理员身份运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!