Taskkill comand error

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
Mado91
Posts: 15
Joined: 16 Mar 2019 08:03

Taskkill comand error

#1 Post by Mado91 » 12 Apr 2019 10:29

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

aGerman
Expert
Posts: 4654
Joined: 22 Jan 2010 18:01
Location: Germany

Re: Taskkill comand error

#2 Post by aGerman » 12 Apr 2019 11:13

/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

Mado91
Posts: 15
Joined: 16 Mar 2019 08:03

Re: Taskkill comand error

#3 Post by Mado91 » 12 Apr 2019 12:33

...Thanks

Post Reply