I ran the following command on the windows command prompt
C:>tasklist /fi \"Imagename eq BitTorrent.exe\"
The output of which is
Similar to previous answers, but uses specific switches in tasklist
to skip header and behave correctly irrespective of spaces in image names:
for /f "tokens=2 delims=," %F in ('tasklist /nh /fi "imagename eq BitTorrent.exe" /fo csv') do @echo %~F
(as run directly from cmd line, if run from batch replace %F
with %%F