Task Scheduler - On Idle


  1. Posts : 4
    Windows 10
       #1

    Task Scheduler - On Idle


    I have a script I created to run after the PC has been idle for one hour. It seems as though no matter what terms I define for trigger conditions, it will run after 10 minutes. 10 minutes is not a condition I have defined anywhere in the Task Scheduler. Is there an actual option here or is it sneakily nonexistent like so many other Windows 10 "features"?
      My Computer

  2. oscer1's Avatar
    Posts : 526
    win 10
       #2

    Hi just have to ask did you check the settings for sleep? it could be set for 10 minutes.
      My Computer


  3. Posts : 4
    Windows 10
    Thread Starter
       #3

    My sleep is set to two hours.
      My Computer

  4. Try3's Avatar
    Posts : 7,464
    Windows 10 Home x64 Version 20H2 Build 19042.928
       #4

    Please post screenshots of your Task definition so we can see what settings you are using.



    It sounds to me that the task is running as soon as Windows enters its Idle state. This is not a property of the task but of the power scheme, which contains difficult-to-get-at settings for several devices including the CPU. You can alter the Idle state for the CPU by using the built-in utility PowerCfg but it has a steep learning curve so it might not be worth the effort.

    If you do not want the task to take any action when Windows reaches its Idle state then your easiest solution might be to insert a waiting period at the start of the script.

    Denis
    Last edited by Try3; 26 Mar 2020 at 02:11.
      My Computer


  5. Posts : 4
    Windows 10
    Thread Starter
       #5

    It makes sense that the idle state occurs after that small period of time, but what doesn't make sense to me is the fact that the conditions around how long it should stay in the idle state before running the task don't seem to apply. Here's my definition:

    Task Scheduler - On Idle-def1.pngTask Scheduler - On Idle-def2.pngTask Scheduler - On Idle-def3.pngTask Scheduler - On Idle-def4.pngTask Scheduler - On Idle-def5.png
      My Computer

  6. Try3's Avatar
    Posts : 7,464
    Windows 10 Home x64 Version 20H2 Build 19042.928
       #6

    Bish,

    Well, I think you have done everything correctly and these guides also agree with you
    Understandingthe Task Scheduler Interface Erwin
    TS- Task Idle Conditions MSDN

    In a ServerFault thread, a user reported the same fault as you and confirmed the behaviour on several other computers. Id say its a Windows bug and you could report it using the Feedback App.
    TaskScheduler - Task Idle Conditions - ServerFault

    Task scheduler is very old, like Event viewer & Disk management, and MS might have a quiet ban on any tinkering with it. They might quietly regard it as deprecated and are thinking about a complete reimplementation at some unspecififed time in the future.

    In the meantime, I suggest that you insert a waiting period in your script to cope with the problem. Since you are running a batch file, the command TimeOut will do the job -
    Response to timeout /?
    Code:
    TIMEOUT [/T] timeout [/NOBREAK]
    Description:
        This utility accepts a timeout parameter to wait for the specified
        time period (in seconds) or until any key is pressed. It also
        accepts a parameter to ignore the key press.
    Parameter List:
        /T        timeout       Specifies the number of seconds to wait.
                                Valid range is -1 to 99999 seconds.
        /NOBREAK                Ignore key presses and wait specified time.
        /?                      Displays this help message.
    NOTE: A timeout value of -1 means to wait indefinitely for a key press.
    Examples:
        TIMEOUT /?
        TIMEOUT /T 10
        TIMEOUT /T 300 /NOBREAK
        TIMEOUT /T -1

    see also TimeOut - SS64

    Denis
    Last edited by Try3; 26 Mar 2020 at 05:18.
      My Computer

  7. Try3's Avatar
    Posts : 7,464
    Windows 10 Home x64 Version 20H2 Build 19042.928
       #7

    Bish,

    You might also consider, as an experiment, triggering the task on a time instead & set it to repeat every hour / 2 hours / whatever but keeping your existing Idle condition in the task definition so that it remains set to do what you originally wanted.

    There is no logical reason to think this will succeed.

    Addn -
    After posting this I found a thread in which such a proposed solution was put forward but its original poster then retracted the proposed solution for reasons I could not understand since the proposed solution had, or so it seemed, passed testing.
    on idle problems and a retracted explanation - EightForums


    Denis
      My Computer


  8. Posts : 4
    Windows 10
    Thread Starter
       #8

    I ended up implementing your suggestion of inserting a waiting period into the beginning of the script using a ping of the localhost. Fortunately the "Stop if computer ceases to be idle" feature under the Conditions tab DOES function as advertised so I've been able to achieve the results I wanted with the de facto "sleep timer" resetting if the computer returns from the idle state before the ping expires. Thank you for the idea, it's a clever one. Cheers!
      My Computer


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd
All times are GMT -5. The time now is 22:59.
Find Us




Windows 10 Forums