Crates.io | elevator |
lib.rs | elevator |
version | 2.0.0 |
source | src |
created_at | 2024-05-10 14:07:16.137822 |
updated_at | 2024-05-11 15:21:25.302061 |
description | run programs with elevated privileges on Windows |
homepage | https://arteiii.github.io |
repository | https://github.com/Arteiii/elevator |
max_upload_size | |
id | 1236022 |
size | 17,240 |
This library provides functions to run programs with elevated privileges on Windows systems.
To use this library in your Rust project, add it to your Cargo.toml:
cargo add elevator
Then you can use it in your Rust code:
use elevator_lib::run_elevated;
// Example: Run a program with elevated privileges
fn main() {
if let Err(err) = run_elevated(r#"C:\Windows\System32\notepad.exe"#, r#"C:\example.txt"#) {
eprintln!("Error: {}", err);
}
}
Install it using Cargo:
cargo install elevator
After installation, you can use it like this:
elevator <program_path> [args...]
For example:
elevator "C:\\Windows\\System32\\notepad.exe" arg1 arg2
This project is licensed under the MIT License - see the LICENSE file for details.