i tried to make an automation to force close apps background process when the apps is closed (exit), in this example i want the script to open list.txt after the telegram.exe is closed, i see telegram.exe background process didn’t closed when i close the apps window, so the scenario didn’t achieved, any solution to force close background process when the window apps closed?
:: Continue checking if Telegram.exe is running
:check_process_running
TIMEOUT /t 10 /nobreak >nul 2>&1
TASKLIST /NH /FI "IMAGENAME eq Telegram.exe" 2>nul | find /I /N "Telegram.exe">nul
IF not "%ERRORLEVEL%"=="1" GOTO check_process_running
:: Wait 10 seconds for Telegram.exe to close and open new apps
TIMEOUT /t 10 /nobreak >nul 2>&1
START "" "C:Usersuserlist.txt"
background process didn’t force closed when the apps window closed
Rifky Syahreza Fahlevi S is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.