Vista uac problems

Discussion in 'Java' started by patrick, Jan 8, 2008.

  1. patrick

    patrick Guest

    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.

    patrick, Jan 8, 2008
    1. Advertisements

  2. patrick

    Daniel Pitts Guest

    I doubt it. You might have to run the Java application as
    administrator. My guess is that the access is cascaded to child
    processes (but I could be wrong).

    Alternatively, you could make a short-cut to that EXE, and mark the
    short-cut as always run as Administrator.
    Daniel Pitts, Jan 8, 2008
    1. Advertisements

  3. patrick

    froboz Guest

    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

    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
    froboz, Jan 8, 2008
  4. patrick

    Daniel Pitts Guest

    Not to mention that you can use the microsoft program "runas" to
    promote your commands privilege level to Administrator.
    Daniel Pitts, Jan 8, 2008
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.