Reputation: 5123
I have two batch file one is always running (listerner.bat) but it is visible,the other one (mystop.bat)is to kill or stop my listener.bat and this two batch file are resides in this path C:\mydemo\mybatchfiles\,I am using windows 7
here is the code for mystop.bat
taskkill /F /FI "WINDOWTITLE eq Administrator: testlistener" /T
but when I run it,it will not terminate the running (listener.bat),There is no error but I have this message when I run it.
INFO: No tasks running with the specified criteria.
I appreciate someone can help me on this.I am new on this batch file command.
Upvotes: 3
Views: 5916
Reputation: 342
I had the same problem. In my case it was that there were two spaces in the window title:
taskkill.exe /F /FI "WindowTitle eq Administrator: TailingErrorLog"
^^
Upvotes: 4
Reputation: 1033
Taskkill considers the command currently executed by listener.bat as part of the title. So you need to add a wildcard "*".
taskkill /F /FI "WINDOWTITLE eq Administrator: testlistener *" /T
Upvotes: 1
Reputation: 71
Try terminating using Im switch ..
Taskkill /Im listener.bat /t /f
Although this is not computer science related question , thought I should help ...
Upvotes: 0