Page 1 of 1

Taskkill comand error

Posted: 12 Apr 2019 10:29
by Mado91
Hi programmers,
I encountered an issue with taskkill command:
I first wrote the following code:

Code: Select all

start notepad.exe
timeout 5
taskkill /IM notepad.exe
pause
it worked properly,
so I tried:

Code: Select all

start chrome.exe
timeout 5
taskkill /IM chrome.exe
pause
then the error message: "ERROR: it's impossible to terminte the process "chrome.exe", this process can only be terminated with the "/F" option"
Ok DOS, as you wish...
so I tried:

Code: Select all

start chrome.exe
timeout 5
taskkill /F chrome.exe
pause
then another error message: "invalid option 'chrome.exe'"
what am I doing wrong?
Thanks everybody

Re: Taskkill comand error

Posted: 12 Apr 2019 11:13
by aGerman
/F is an additional option. You still have to use /IM to introduce the process name.
Why do people never read the help messages of a command? All you have to do is executing TASKKILL /?

Steffen

Re: Taskkill comand error

Posted: 12 Apr 2019 12:33
by Mado91
...Thanks