A nasty problem popped out with my software. I am making a program that interacts with another existing software (a game). User has reported that he runs the game with administrator privileges and under that circumstances, my program stops working for him.

Short investigation revealed that some people really need to run the game under administrator account and some don't. It would be great if my program would be able to detect this and warn user if the game is running under administrator account:

![image description](https://i.stack.imgur.com/7fU1D.png)

If the user clicks "Elevate", I'd like to ask windows to elevate the `java.exe` running my `jar` file and invoke the typical UAC dialog.

![image description](https://i.stack.imgur.com/Sj4kq.png)  

Obviously, this time the question would not be about java updater but JRE

My question is: Is this possible? Can windows elevate my `java.exe` instance's privilege? Does java have a way to do it? Or can I use command line command?

I want to avoid restarting the program (though it wouldn't probably be such a big deal).

**Edit:**
If you look in the comments, you'll see that there's no avoiding the restart of an application - process can only *start* elevated, not *become elevated*. This kinda shifts the question, unfortunately. Basically, it now sounds more like: "*How to restart my application with admin rights?*". Unless, of course, there's a trick like two `java.exe` sharing one jar...