I’m trying to produce a batch file that can check to see if a process is running such as a game, photoshop, or media and terminate a specific process. In this case ‘f.lux’ considering it dims the screen and can affect color quality. I’ve looked for some answers on here for this with no luck, as most of the content is older and I’m not sure how much has changed in Windows 10. So far here is what I have picked up off of some other posts.
tasklist /FI "IMAGENAME eq example_process.exe" 2>NUL | find /I /N "example_process.exe">NUL
if "%ERRORLEVEL%"=="0" taskkill /im f.lux.exe
Not sure how correct this is, so any advice or help would be appreciated.
Thanks.
2
Answers
either this or
See
taskkill/?
Just change to your task to be killed instead of
iexplore.exe
task in this example :