No, wildcards are not allowed at the beginning of a filter.
for /f "tokens=2 delims=," %%a in (' tasklist /fi "imagename eq cmd.exe" /v /fo:csv /nh ^| findstr /r /c:".*X[^,]*$" ') do taskkill /pid %%a
This will result in a list of tasks in csv and verbose format (which will include the window title as the last field in the output).
The list is filtered by findstr with a regular expression that will search for the specified text ( X ) in the last field.
If any line matches the filter, for will marx it, extracting the second field (PID), which will be used in taskkill to complete the process.
MC ND
source share