TASKKILL

Hi everyone
i wanna kill a exe file with TASKKILL
for example:
 
system("TASKKILL /F /IM chrome.exe 2>NULL")

it works fine
but it shows some status in the command prompt
1
2
3
4
5
6
7
SUCCESS: The process "chrome.exe" with PID has been terminated.
SUCCESS: The process "chrome.exe" with PID has been terminated.
SUCCESS: The process "chrome.exe" with PID has been terminated.
SUCCESS: The process "chrome.exe" with PID has been terminated.
SUCCESS: The process "chrome.exe" with PID has been terminated.
SUCCESS: The process "chrome.exe" with PID has been terminated.
SUCCESS: The process "chrome.exe" with PID has been terminated.

I don't need those lines.
thanks
Last edited on
I'm pretty sure system("TASKKILL /F /IM chrome.exe 1>NULL") will work. "2" stands for stderr stream, 1 for stdout.
thanks a lot
its work finesystem("TASKKILL /F /IM chrome.exe 1>NULL")
but it gave me an error when the chrome doesn't open
ERROR: The process "chrome.exe" not found
you know i don't want any status at all .
TASKKILL /F /IM chrome.exe >NUL 2>&1
Last edited on
thanks
but system("TASKKILL /F /IM chrome.exe >NUL 2> 1");
that one works without &
Topic archived. No new replies allowed.