Class Elevation


public class Elevation extends Object
Collection of methods regarding the UAC elevation state on Windows Vista or higher.
  • Method Details

    • getElevationState

      public static ElevationState getElevationState()
      Returns the elevation state of the current process.
      the elevation state or null if not called on Windows.
    • executeElevated

      public static boolean executeElevated(File executable, String parameters, File directory)
      Runs an executable in elevated state. Blocks until all UAC dialogs have been answered.
      executable - the executable
      parameters - parameters passed to the executable. Can be null.
      directory - The working directory for the process. If null the current working directory is used.
      false if the process cannot be started. Includes a cancelled UAC request.