General Question

How can I add an ELSE to this batch script?
Basically I want to add “ELSE” to this batch command, where if the program is running it says it is, but if it isn’t then it says it sin’t, like so:
Original
tasklist /nh /fi “imagename eq explorer.exe” | find /i “explorer.exe” >nul && (
echo Explorer.exe is running)
Desired
tasklist /nh /fi “imagename eq explorer.exe” | find /i “explorer.exe” >nul && (
echo Explorer.exe is running) ELSE (echo Explorer.exe is not running)
However, it says ELSE was not expected at this time. How can I tweak this to work?
Observing members:
0
Composing members:
0


2 Answers
Answer this question
This question is in the General Section. Responses must be helpful and on-topic.
Have a question?
Ask Fluther!