2

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>

1 Answer 1

0

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.

12
  • My task is not scheduled in the way you said, it's set to start when computer is idle for 1 min, but it never starts in PC1. Also if I press Run in Task Scheduler the task runs normally. I've updated the question with screenshot of the task details if you could check.
    – Tak
    Commented Jul 15, 2020 at 8:57
  • What is in the idle settings tab ? Did you set activation time ? It's a similar case with what I said in the answer. If it works manually means credentials are fine, you need to make sure activation conditions are good also. The settings part depend a lot on what the task does; more details are needed here like how much time must it run ?
    – Overmind
    Commented Jul 15, 2020 at 9:30
  • I’ve included screenshots including one of the settings tab in the question. The activation is to ‘start the task only if the computer is idle for 1 minute’. The task runs an exe of a winform application I made which is just a windows form that opens with some info then the user normally will close it down like any other window.
    – Tak
    Commented Jul 15, 2020 at 9:40
  • I meant what's under triggers --> idle/edit.
    – Overmind
    Commented Jul 15, 2020 at 9:54
  • I've updated my question with a screenshot of the triggers edit window and I've also included the xml of the task.
    – Tak
    Commented Jul 15, 2020 at 10:21

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .