Windows Server 2016 scheduled task run time limitation

Mallikarachchi, Jay S 1 Reputation point
2022-01-13T21:42:51.82+00:00

I have Automated test scripts run on the 2016 server with task scheduler. one of the scripts running more than 10 minutes to test the application. But I noticed it stopped after 10 minutes of run time.
I did all modifications and changed the script too. But it always stops after running for 10 minutes.
By researching, I found the default time is 600 seconds, but it can increase.
Not sure where and how to change that setting.
That is NOT the "Stop the task if it runs longer than:" which I have set to 4 hours.

See below link for information I found in the research. But not sure this is applicable or not.
https://stackoverflow.com/questions/61020147/what-is-the-time-limit-for-a-scheduled-task

Windows Server Management
Windows Server Management
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.Management: The act or process of organizing, handling, directing or controlling something.
423 questions
0 comments No comments
{count} votes

4 answers

Sort by: Most helpful
  1. Mallikarachchi, Jay S 1 Reputation point
    2022-01-13T22:03:54.907+00:00

    Update: I ran the .bat file manually in the same server, but not thru the task scheduler, and it ran completely, without any issue.
    Server information - MS Windows 2016 standard - version 10.0.14393 Build 14393 - VM server

    0 comments No comments

  2. Limitless Technology 39,451 Reputation points
    2022-01-14T19:51:51.373+00:00

    Hello @Mallikarachchi, Jay S

    The other option about duration is the Trigger option for "Repeat task every XX minutes" and "for a duration of XX minutes"

    Hope this helps with your query,

    -----------

    --If the reply is helpful, please Upvote and Accept as answer--


  3. MotoX80 32,431 Reputation points
    2022-01-15T00:09:52.367+00:00

    You have to capture stdout and stderr to see what the bat file is doing. Set the task to run cmd.exe. In the arguments field set it to something like:

    /c C:\Scripts\YourTestScript.bat  1>>"C:\Scripts\Logs\YourTestScript-%date:~10,4%-%date:~4,2%%date:~7,2%.log" 2>&1
    

    That will create a daily log file of all executions of the task.

    0 comments No comments

  4. Mallikarachchi, Jay S 1 Reputation point
    2022-01-26T17:59:56.46+00:00

    Hi All,
    Thanks for the reply. The log file didn't give anything valuable to identify the issue.
    I noticed this issue happened after 01/12/2022 when the Windows auto-update occurred. So it may be related to that.

    Instead of spending more time troubleshooting, I divided scripts to run less than 10 minutes, and it is working now.
    I hope the following windows updates will fix the issue.

    Thanks again.

    0 comments No comments