I\'m trying to run taskkill on a console window that has spaces in it\'s title. How can I pass this window title to taskkill. I have tried the following:
tas
I guess this task run on your windows server . If the title includes "Administrator : " you can not kill the task via WindowTitle equal.
You should use this : This is my killer.bat. SEARCH_PARAMETER = WHAT TITLE YOU WANNA KILL
@echo off
for /f "tokens=2 delims=," %%a in ('
tasklist /fi "imagename eq cmd.exe" /v /fo:csv /nh
^| findstr /r /c:".*SEARCH_PARAMETER[^,]*$" ') do taskkill /pid %%a