Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CreateProcess error=740, The requested operation requires elevation

Tags:

java

I have a web applet that I update regularly and I finally decided to make an updater. However when I download an update in java it downloads fine. However when I try to unpack + run the update by using Runtime.getRuntime().exec(pathToFile); I get CreateProcess error=740, The requested operation requires elevation

How can I fix this if the program is a web applet? I can't just tell them to run their browsers as administrators. How can i fix this?

like image 927
Kyle Avatar asked May 02 '11 04:05

Kyle


1 Answers

When using .exec(cmd), prefix your command with cmd /c so you end up with something like rt.exec("cmd /c <your command>"). This will launch the process and invoke the UAC if needed.

like image 169
Doug Avatar answered Oct 06 '22 00:10

Doug