Nov-12-2019, 09:49 AM
Hi, I probably have a tricky question here. I'd like to know if there's a way in python to detect (maybe using an infinite loop in a script run in background) if windows is shutting down, does anyone know how to do this?
Detecting windows shutdown event
|
Nov-12-2019, 09:49 AM
Hi, I probably have a tricky question here. I'd like to know if there's a way in python to detect (maybe using an infinite loop in a script run in background) if windows is shutting down, does anyone know how to do this?
Nov-12-2019, 12:38 PM
other than blue screen of death?
Windows has a way of exploding. Microsoft has a blog on this here: https://social.msdn.microsoft.com/Forums...rplanguage
Nov-12-2019, 04:10 PM
I read the post you linked, but I don't need to interrupt shutdown process, I essentially want to execute a script when the shutdown button is pressed (not the physical one) and make sure that it execute correctly.
Nov-12-2019, 04:49 PM
Quote:I'd like to know if there's a way in python to detect (maybe using an infinite loop in a script run in background) if windows is shutting dowThe first reply explains on URL I provided: 'how to intercept the shutdown command.' you don't have to use the code verbatim, just use the 'Detect' part!!!
Nov-12-2019, 04:51 PM
It looks like you could create a batch file to run your script on Windows shutdown.
Excecute code on Windows shutdown |
|