2

I am developing a java project. This project need administrator privilege to execute some of the process. Is there any way to give admin privilege to user. OR ask for admin privilege while running the project?

lankabeta
  • 91
  • 2
  • 7
  • 15

1 Answers1

2

As far as I know each process has the user privileges (user who launch the process). So, you shoud launch a new process in name of a administrator user to have such privileges. It depends on Operating System how to implement it...

yoprogramo
  • 1,306
  • 9
  • 14
  • 1
    Not too good... But, I think you can create a program to launch the administrative process and give the "Run as administrator" privilege to this launcher. Your main program should call this launcher when needed. (I don't use windows, but I think this should work). – yoprogramo Oct 21 '11 at 07:05
  • 1
    You can use Windows XP-style .manifest file under Windows 7. The application shortcut will display a security symbol overlay icon over the app's icon to show that this program has user security elevation to "run as administrator". This can be done so with a combination of Launch4J launcher (a wrapper), InnoSetup installer and other setup tools for Java programs...see [http://stackoverflow.com/questions/1385866/java-run-as-administrator](http://stackoverflow.com/questions/1385866/java-run-as-administrator) – ee. Oct 21 '11 at 08:56