0xC0000142 Errors from Tasks in Windows Task Scheduler

-1

I previously had many C++ .exe programs (developed with C++ Builder XE7) running as scheduled tasks in a Windows 2008 R2 Datacenter server. These tasks were being run by the SYSTEM account and I never had any issues with them before.

I recently imported these tasks to a new Windows 2019 Datacenter server and set these tasks up in the Task Scheduler. The same SYSTEM account is being used to run the tasks, but with the updated Windows Server, these tasks now give me a run result of 0xC0000142.

Most of the resources I found online say to increase the desktop heap size in the registry editor - I have done this multiple times and restarted the server after each increase, but I was still getting the same results with this method so I reset the desktop heap size back to the original value.

I also thought it had to do with missing C++ redistributables - the new server only had redistributables from 2015-2019, while the 2008 R2 server had these along with redistributables from 2013 and 2008. So I installed these extra redistributables but I still got the same result.

I have tried manually recreating the tasks, I tried running the tasks with different domain admin accounts, also played around with the "run only when user is logged in/run whether user is logged in or not" setting. All of these led to the same 0xC0000142 error.

Also, there were no errors being shown in Windows Task Scheduler history or in the Event Viewer.

I tried monitoring the task with Process Monitor, below is a snippet of the log output leading up to the exit code. I know that error code 0xC0000142 is STATUS_DLL_INIT_FAILED. Right before the failure, tzres.dll.mui and tzres.dll are the last files accessed. There are no failure messages with these files other than the FILE LOCKED WITH ONLY READERS - I believe this is for read-only access, but these files are also read-only access on the old server where the tasks are working...

Process Monitor logs

Any extra tips/guidance would be much appreciated!

windows-server-2008
windows-server-2019
task-scheduler
asked on Server Fault Apr 22, 2021 by MERNboy

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0