I would like to create a script which can close a launcher.exe once his program related is closed.
Here are the steps:
- the script runs launcher.exe
- the script is pending, as i authenticate to start program.exe (program.exe runs right way on its own after my log-in)
- then the script should continuously check if program.exe is still running
- once no program.exe is found, the script closes launcher.exe
- closing of the script
I found this idea from Exaskryz in another topic, but i don't succeed to adapt it to my need:
Code: Select all
#Persistent
#SingleInstance
Run, launcher.exe
SetTimer, check, 500
return
check:
Process, Exist, program.exe
If (ErrorLevel=0) ; process not found
Process, Close, launcher.exe
Process, Exist, launcher.exe
If (ErrorLevel=0)
Process, Close, program.exe
return