Crates.io | win_run |
lib.rs | win_run |
version | 0.2.1 |
source | src |
created_at | 2022-12-29 01:58:03.72188 |
updated_at | 2023-05-16 20:31:20.115045 |
description | Run any executable as User, Admin or Local System from a Windows Service. |
homepage | https://github.com/hristogochev/win_run |
repository | https://github.com/hristogochev/win_run |
max_upload_size | |
id | 747083 |
size | 22,488 |
Run any executable as User, Admin or Local System from a Windows Service.
To use this crate, add win_run
as a dependency to your project's Cargo.toml
:
[dependencies]
win_run = "0.2.1"
In order for any of the functions offered by the library to work they must be run from a Windows Service!
Start a process as Admin on the Default desktop:
use win_run::{Desktop, Elevation, win};
win("/path/to/executable")
.args("-flag")
.directory("/parent/directory")
.desktop(Desktop::Default)
.elevation(Elevation::Admin)
.run()?;
Start a process as Local System on the Secure desktop:
use win_run::{Desktop, Elevation, win};
win("/path/to/executable")
.args("-flag")
.directory("/parent/directory")
.desktop(Desktop::Secure)
.elevation(Elevation::LocalSystem)
.run()?;
Licensed under MIT license.