1

I have a task in task scheduler and I want to run this task once the screen sleeps not the computer. I’ve tried setting the Trigger to be “On Idle” but didn’t work, and I tried setting the trigger to be “On an event” and chose Log “System” and source ID to “Kernel-Power” and Event ID to “42” but still didn’t work as it works when the system itself sleeps not the screen. Could anyone please advise how I can run the task when then screen go to sleep not the PC itself?

enter image description here

Tak
  • 481
  • 2
  • 5
  • 20
  • Does your system record an event 42 when the screen turns off? – music2myear Jul 13 '20 at 22:03
  • @music2myear Thanks for your comment. How to know that? – Tak Jul 13 '20 at 22:13
  • The Event Viewer is typically where you see system events. If you're not familiar with that I strongly suggest you learn more about it. If you wish to trigger a task based on a specific event ID you'll need to know that your system is generating these IDs at the time you expect. – music2myear Jul 13 '20 at 23:13
  • @music2myear Oh yes, sorry I misunderstood your question. Yes, I see that the system records event 42 when the computer sleeps not when the screen sleeps, any advice? – Tak Jul 13 '20 at 23:16
  • Now you know you've picked the wrong trigger. – music2myear Jul 13 '20 at 23:26
  • I checked through 2 systems here and Event 42 only records system sleep. No events at all for screen turn off (which is frequent on both machines) – John Jul 13 '20 at 23:27
  • @music2myear Yes, but how I know which is the correct one to use? – Tak Jul 13 '20 at 23:28
  • @John So there is no way to trigger something when the display sleeps? My trigger launches an application so maybe there is another way to trigger it without task scheduler? – Tak Jul 13 '20 at 23:48
  • I am very certain there is no way to trigger an event when the screen turns off. I checked a third machine and no event – John Jul 13 '20 at 23:49
  • @John So this means that this is not feasible even without the task schedular? – Tak Jul 13 '20 at 23:51
  • Yes. I do not see any event or action when the screen goes black. On one machine, then screen going black is also a function of the independent screen. My laptops have integrated screens. – John Jul 13 '20 at 23:53
  • Now, we ask what you're trying to do. You can't do it the way you want, but if you tell us what you're actually trying to do we might be able to find other ways. – music2myear Jul 14 '20 at 03:47
  • @music2myear I have an exe I want to run after the computer is idle (by idle I don’t mean sleep, I mean not being used) for sometime lets say 30 mins. Once the idle timeout reaches I want the application to run without having the windows lock-screen appearing. Saying that this PC is set up to only have the option “Screen sleep after “ in the Power options. Any idea how this can be done? – Tak Jul 14 '20 at 05:41

1 Answers1

1

There are no consistent events triggered based on screen power state changes, therefore there is no way to trigger a task based on this.

music2myear
  • 40,472
  • 44
  • 86
  • 127
  • As per your advice, answered accepted and upvoted. I have asked another question here if you could check and advise please https://superuser.com/q/1568457/391215 – Tak Jul 14 '20 at 06:01