Is there a way to run a Windows Vista .exe application as administrator from
within a java application, using Runtime.getRuntime.exec or otherwise ??
i.e. equivalent to right clicking the .exe and runnning as administrator.
TIA
When you execute a process with Runtime you will execute with the
authority of the process you started Java with. If you started the
JRE as Administrator then your process will inherit administrative
authority. Without creative measures, child processes inherit the
authority of the parent process. There are a few ways around this.
You can have a Java server process running with Adminstrative
privileges performing activities on behalf of other non-privilged
processes (using RMI or web services perhaps).
Of course, regardless of your architectural approach, if your
privilged process is performing activities for non-privileged
processes then the burden of access control enforcement is with your
privleged process. For example, a risk of such a model is where a non-
privleged process causes the privleged process to perform an
unintended activity -- otherwise known as privilege escallation
attack.
Another implementation option since you are working with Microsoft
technology would be make a special exe you call from Java that can run
with elevated privileges. There are API's on the Microsoft platform
to run as other users.
Hope all this is helpful and not more confusing.
Milton Smith
(e-mail address removed)