windows-elevate

Crates.iowindows-elevate
lib.rswindows-elevate
version0.1.0
sourcesrc
created_at2024-09-02 10:58:06.096848
updated_at2024-09-02 10:58:06.096848
descriptionwindows-elevate is a Windows-only library which provides utility functions to help elevating process permissions.
homepagehttps://github.com/NenX/windows-elevate
repositoryhttps://github.com/NenX/windows-elevate
max_upload_size
id1360384
size10,951
Lam (NenX)

documentation

README

windows-elevate

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.

Example

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
}
Commit count: 0

cargo fmt