Windows – Task scheduler On Idle task not triggered Windows 7

idlescheduled-taskstask schedulerwindows 7windows task scheduler

I've used Task scheduler and 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. Also if I press Run in Task Scheduler the task runs normally in PC2 it just never triggers automatically when idle for 1 min. 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?

Below is how my scheduled task looks in task scheduler:

enter image description here

enter image description here

enter image description here

enter image description here

enter image description here

Also here is the xml of my Task:

<?xml version="1.0" encoding="UTF-16"?>
<Task version="1.2" xmlns="http://schemas.microsoft.com/windows/2004/02/mit/task">
  <RegistrationInfo>
    <Date>2019-11-20T15:43:06.6081219</Date>
    <Author>MyPC\MyUser</Author>
    <URI>\MyAppIdleTask</URI>
  </RegistrationInfo>
  <Triggers>
    <IdleTrigger>
      <Enabled>true</Enabled>
    </IdleTrigger>
  </Triggers>
  <Principals>
    <Principal id="Author">
      <UserId>S-1-5-21-1004336348-1177238915-682003330-385281</UserId>
      <LogonType>InteractiveToken</LogonType>
      <RunLevel>LeastPrivilege</RunLevel>
    </Principal>
  </Principals>
  <Settings>
    <MultipleInstancesPolicy>IgnoreNew</MultipleInstancesPolicy>
    <DisallowStartIfOnBatteries>true</DisallowStartIfOnBatteries>
    <StopIfGoingOnBatteries>true</StopIfGoingOnBatteries>
    <AllowHardTerminate>true</AllowHardTerminate>
    <StartWhenAvailable>false</StartWhenAvailable>
    <RunOnlyIfNetworkAvailable>false</RunOnlyIfNetworkAvailable>
    <IdleSettings>
      <Duration>PT1M</Duration>
      <WaitTimeout>PT0S</WaitTimeout>
      <StopOnIdleEnd>true</StopOnIdleEnd>
      <RestartOnIdle>false</RestartOnIdle>
    </IdleSettings>
    <AllowStartOnDemand>true</AllowStartOnDemand>
    <Enabled>true</Enabled>
    <Hidden>false</Hidden>
    <RunOnlyIfIdle>true</RunOnlyIfIdle>
    <WakeToRun>false</WakeToRun>
    <ExecutionTimeLimit>PT72H</ExecutionTimeLimit>
    <Priority>7</Priority>
  </Settings>
  <Actions Context="Author">
    <Exec>
      <Command>C:\MyWinFormApp\MyWinForm.exe</Command>
    </Exec>
  </Actions>
</Task>

Best Answer

There are several things you need to watch for when you schedule a task.

One of the main ones I found is the timing.

For example, let's say it's 0018h right now and you schedule a task to run at 0000h daily every 5 minutes. You make all settings, put all conditions, test-start the task and it's fine, all seems good but the task will not start even if the conditions are met. That happens because of the exceeded schedule. It will only start at the next 0000h. So if it's 0018h and you actually want to see the task working, put it at an immediately later time instead, like 0024h and make sure that the set time is not exceeded while you're configuring it.

Then, you can make sure other conditions are fine, like the ones related to power-states, network availability, success state.

Another very important aspect: make sure the credentials used to run it have enough privileges to actually run it. That part is easier to check because you can manually test it.

Related Question