Crates.io | windows-elevate |
lib.rs | windows-elevate |
version | 0.1.0 |
source | src |
created_at | 2024-09-02 10:58:06.096848 |
updated_at | 2024-09-02 10:58:06.096848 |
description | windows-elevate is a Windows-only library which provides utility functions to help elevating process permissions. |
homepage | https://github.com/NenX/windows-elevate |
repository | https://github.com/NenX/windows-elevate |
max_upload_size | |
id | 1360384 |
size | 10,951 |
windows-elevate is a Windows-only crate, it provides two utility functions:
check_elevated()
is used to determine whether the current process is running as elevated.elevate()
is used to elevate the current process permissions.use windows_elevate::{check_elevated, elevate};
fn test_elevate() {
let is_elevated = check_elevated().expect("Failed to call check_elevated");
if !is_elevated {
elevate().expect("Failed to elevate");
return;
}
// From here, it's the new elevated process
}