I have a program (program.exe) which I want to be closed when my laptop goes to sleep either if the sleep button was pressed, the lid was closed or some time has passed and entered automatically in sleep mode.
I suspect is something from the Task Scheduler but I don't know how to find event "When laptop goes to sleep" and then to close program.exe
I know that maybe I can do a Python script but I feel Task Scheduler it's the easiest way and maybe someone else, like me, needs to fix the same challenge.
Thanks!
After some digging, I found the solution I will post it here maybe it helps someone at some moment.