5 releases
0.2.4 | Oct 11, 2023 |
---|---|
0.2.3 | Oct 9, 2023 |
0.1.2 |
|
#162 in Windows APIs
127 downloads per month
5KB
check_elevation
A tool to check the elevation status through a simple function.
Successor to is_elevated.
Example
use check_elevation::is_elevated;
fn main() {
if is_elevated().expect("Failed to get elevation status.") {
println!("Running as administrator.");
} else {
println!("Not running as administrator.");
}
}
Dependencies
lib.rs
:
Checks if the current Windows process is elevated. Returns true if the process is elevated, false if not.
Example
use check_elevation::is_elevated;
fn main() {
if is_elevated().expect("Failed to get elevation status.") {
println!("Running as administrator.");
} else {
println!("Not running as administrator.");
}
}
made with ♥ by h4rl uses bsd-2-clause license
Dependencies
~130MB
~2M SLoC