elevate-ti 0.1.0

A safe, idiomatic Rust library to obtain Windows TrustedInstaller privileges
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
//! Example demonstrating spawning a custom process (e.g. cmd.exe)
//! directly with elevated `TrustedInstaller` privileges.

use elevate_ti::elevated_command;

fn main() -> Result<(), Box<dyn std::error::Error>> {
    println!("Spawning an elevated Command Prompt...");

    elevated_command()?
        .exe("%SystemRoot%\\System32\\cmd.exe")
        .args("cmd.exe /k whoami /groups")
        .spawn()?;

    println!("Elevated Command Prompt spawned successfully.");
    Ok(())
}