fix, win, elevate prompt on start

Signed-off-by: dignow <linlong1265@gmail.com>
This commit is contained in:
dignow 2023-07-11 12:19:28 +08:00
parent f5d0cece43
commit 97359d6eae

View File

@ -2277,11 +2277,11 @@ fn run_after_run_cmds(silent: bool) {
#[inline]
pub fn try_kill_broker() {
allow_err!(run_cmds(
format!("taskkill /F /IM {}", WIN_MAG_INJECTED_PROCESS_EXE),
false,
"kill_broker"
));
allow_err!(std::process::Command::new("cmd")
.arg("/c")
.arg(&format!("taskkill /F /IM {}", WIN_MAG_INJECTED_PROCESS_EXE))
.creation_flags(winapi::um::winbase::CREATE_NO_WINDOW)
.spawn());
}
#[cfg(test)]