CreateProcess error=740, The requested operation requires elevation

java

Solution

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.

Problem

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?

Original source