I want to find process with title containing some string and pass it's PID to taskkill, but I can't find proper syntax, can somebody tell what is wrong with this line?
C:\>cmd /c for /f "tokens=2 delims=," %a in
('tasklist /v /fo:csv /nh | findstr /r /c:"1234"') do taskkill /f /pid %a
Result:
FINDSTR: Cannot open do
FINDSTR: Cannot open taskkill
FINDSTR: Cannot open /f
FINDSTR: Cannot open /pid
FINDSTR: Cannot open %a