开发者

java-running executable with admin privilege

How to call executable bat file with admin privilege from java program ? T开发者_Python百科hat executable is in another directory.


You need use the runas command. Something like the following:

Runtime.exec("runas /user:ROOTUSERNAME c:\yourdir\yourbat.bat");

Of course, the windows ROOTUSERNAME user must have admin priviledge.

P.S.: I don't know why people voted this question down, it is a valid one...

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜