Answer the question
In order to leave comments, you need to log in
Answer the question
In order to leave comments, you need to log in
And so?
@echo off
set cod4=qbittorrent.exe
FOR /F %%x IN ('TASKLIST /FI "IMAGENAME eq %cod4%"') DO IF %%x == %cod4% goto Found
:Found
echo Found
TASKLIST /NH /FI "IMAGENAME eq %cod4%"
$cod4 = "qbittorrent.exe"
Get-Process | where{$_.ProcessName -like $cod4} | select ProcessName
Add a space between the double quote and the single quote at the end of tasklist. When they are written together they do not work as they should. Now I don't have Windows at hand, so I can't check. But this is a well-known bug feature, I stepped on it myself.
Well, the Found label, of course, must be present in the script.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question