this feels like a stupid issue but I can't solve it somehow. I want my batch file to check if a specific process is running. I've used an example from this page and it's working sometimes:
@echo off
tasklist /FI "IMAGENAME eq My Auto Updater.exe" 2>NUL | find /I /N "My Auto Updater.exe" >NUL
if "%ERRORLEVEL%"=="0" echo Program is running
PAUSE
This works as expected and tells me if "My Auto Updater.exe" is running. However, I noticed that this exact same code won't work for other Exe files, a random example where it fails to detect if the process is running:
@echo off
tasklist /FI "IMAGENAME eq Office 15 Click-to-Run Localization Component.exe" 2>NUL | find /I /N "Office 15 Click-to-Run Localization Component.exe" >NUL
if "%ERRORLEVEL%"=="0" echo Program is running
PAUSE
I can't figure out why this fails with the example "Office 15 Click-to-Run Localization Component.exe". Could it have something to do with the numbers in the exe name? I appreciate every answer!