I have this program that searches a directory for files and uploads the file data to a backend system. It used to run as a scheduled task in Windows Server 2008 R2 machine - here, the program has worked fine for years and usually completes successfully after a few minutes. When I take this same program and set it up to run as a scheduled task in Task Scheduler on a Windows Server 2019 machine, I do not get the same behavior. The program often executes very slowly and eventually times out because it takes too long trying to process files into the backend. The program also writes to logs regularly as it runs, but on Windows Server 2019, logs are not written until the timeout. Also, a week ago, this same program on Windows Server 2019 would sometimes complete successfully (even though its slow still), now it never runs to completion. What's with the completely different behavior on the two machines? I heard there was a bug introduced in Server 2016 - the workaround was to use a One Time trigger that runs indefinitely (like in this link: https://rudimartinsen.com/2017/07/05/differences-and-bugs-in-windows-2016-task-scheduler/) instead of a daily trigger. I tried this workaround, but I still have the same issue. I do not see any problems or errors in Event Viewer when it attempts to run, also the CPU usage looks pretty normal during program execution. The program also runs normally when I debug it in my IDE on my local machine, so the issue only comes when it is setup in Task Scheduler. Any help is much appreciated.