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...
精彩评论