Windows – Run exe when computer is inactive for some time


Following an advice given to me in this question I have made this question. So I have an exe I want to run after the computer is idle (by idle I don’t mean sleep, I mean inactive or not being used) for sometime lets say 30 mins. Once the “inactive” timeout reaches I want the application to run. Saying that my PC is set up to only have the option “Screen sleep after “ in the Power options no Computer sleep, so the PC doesn’t go to sleep or the screen gets lock-screen unless I forced it using Windows+L keys, and I want to keep these settings as it is. I want to detect an inactivity time period and once the inactivity time period is reached then I want to execute an exe. Any idea how this can be done?


I've followed the steps provided in the answers:

Created a new task, added a trigger, set it to event: on Idle and created the task. In the conditionstab, specified the task waits 1min to become idle (instead of 10min just to test).

But then I wait for more than 10mins and the task is never triggered on PC1 but triggers on another PC2. I've checked online and found that PowerCfg -requests will show what is stopping the PC from being Idle and when I run it on PC2 nothing returns but when I run it on PC1 I get this "Legacy Kernel Caller" driver.

So I used Powercfg -requestsoverride but when I run powercfg -requestsoverride Driver "Legacy Kernel Caller" System , where it succeeds and I find it in the Powercfg -requestsoverride list, but then powercfg -requests it still shows [DRIVER] Legacy Kernel Caller under SYSTEM: and the task is never triggered any advice please?

Best Answer

What you want is easy. You can do it using task scheduler.

When creating a task, under Conditionstab, you have the option to start the task if computer is idle for: . In there just put how much idle time you want.

enter image description here

Just program the .exe you want to run, how often you want it and then use the idle condition.