tasklist /FI "IMAGENAME eq modulename.exe" - and do whatever you need with the result. - Akina
Thank.Yes, he now shows only one process.How can I get an unequivocal answer in the if structure? - Predicate
|
1 answer 1
@echo off if '%1'=='' goto usage for /F %%a in ('tasklist.exe /FI "IMAGENAME eq %1"') do if %%a==%1 goto exist echo Module %1 not found in processlist. goto done :usage echo USAGE: %0 modulename.ext goto done :exist echo Module %1 is running. :done
AkinaAkina
15.2k11 golden mark1010 silver marks2929 bronze marks
tasklist /FI "IMAGENAME eq modulename.exe"- and do whatever you need with the result. - Akina