I wrote a batch script to find out if a specific process runs on a computer:
for /f %%a in (computers.txt) do (
PsList.exe \\%%a -e "process" > result.txt
Find /i "found" < result.txt
IF "%ERRORLEVEL%" == "0" echo %%a >> Computers_without_process.csv
)
I did Find /i "found" < result.txt
because if the process is not found it returns: "process ... was not found on computername"
if the process is found it returns it's information. and the string "found" isnt there.
I tried just about anything.
Thanks for your help!
You need delayed expansion
or you can use conditional execution (and pipes):