just wondering whether its possible to run a script when Windows turns the screen off after a period of inactivity (not sleep or hibernate but just switching off the screen) as well as when the user wakes the computer back up, if so how?
Thanks.
just wondering whether its possible to run a script when Windows turns the screen off after a period of inactivity (not sleep or hibernate but just switching off the screen) as well as when the user wakes the computer back up, if so how?
Thanks.
If a Windows computer is running (not suspended) and the screen turns of as a result of Windows Power Management and (possibly) the screen settings, then Windows is still running.
Scripts run via Task Scheduler or like will run. Updates will run. Actions like restart from Update will start up the screen.
Also if you remote in from another computer, the screen will turn on.
So there are some variations, but the computer will run scripts if the screen is off.
If you wish to try running a script resulting from a power event, you need to check the event logs.
Please see: Display all power related events (turn-on/-off/sleep/hibernate/...)?
If all this does not work (and I suspect not) then you most likely cannot do what you want. I have not run across any request (hundreds of customers) who need to be alerted when the screen turns off.