Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Kill fails on Windows #257

Closed
ghost opened this issue Feb 9, 2020 · 1 comment · Fixed by #263
Closed

Kill fails on Windows #257

ghost opened this issue Feb 9, 2020 · 1 comment · Fixed by #263

Comments

@ghost
Copy link

ghost commented Feb 9, 2020

On Windows, sysinfo 0.10.5.

I have a Process named proc, and I issue proc.kill(Signal::Kill) to no effect.

However, this works fine using only std functionality:

let mut kill = process::Command::new("taskkill.exe");
kill.arg("/PID").arg(proc.pid().to_string()).arg("/F");
if let Err(e) = kill.output() {
   error!("couldn't kill: {}", e)
}

EDIT: I tried to kill console windows of a running rust program. If the rust program runs as its own window, I don't need the /F flag. If I run it within the VS code terminal window, /F was needed.
proc.kill(Signal::Kill) did not work for both cases.

@GuillaumeGomez
Copy link
Owner

Interesting. I'll check what's going on. Thanks for the report!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant