# Elevation

Import: `import com.install4j.api.windows.Elevation;`

```java
public class Elevation
```

Collection of methods regarding the UAC elevation state on Windows Vista or higher.

## Methods

| Signature | Returns | Description |
|---|---|---|
| [`getElevationState()`](#getelevationstate) | `ElevationState` | Returns the elevation state of the current process. |
| [`executeElevated(File, String, File)`](#executeelevated-file-string-file) | `boolean` | Runs an executable in the elevated state. |

### getElevationState()

```java
public static ElevationState getElevationState()
```

Returns the elevation state of the current process.


**Returns:** the elevation state or `null` if not called on Windows.

### executeElevated(File, String, File)

```java
public static boolean executeElevated(File executable, String parameters, File directory)
```

Runs an executable in the elevated state. Blocks until all UAC dialogs have been answered.


**Parameters:**

- `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.

**Returns:** false if the process cannot be started. Includes a canceled UAC request.

