Crates.io | check_elevation |
lib.rs | check_elevation |
version | 0.2.4 |
source | src |
created_at | 2023-10-08 16:43:34.014746 |
updated_at | 2023-10-11 09:40:12.810099 |
description | Check if the current process is elevated. A successor to the `is_elevated` crate. Now no_std! |
homepage | https://github.com/h4rldev/check_elevation |
repository | https://github.com/h4rldev/check_elevation |
max_upload_size | |
id | 997280 |
size | 6,033 |
A tool to check the elevation status through a simple function.
Successor to is_elevated.
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.");
}
}