Solved: How do I fix Windows Server 2012 R2 scheduled task hang and never complete

Problem Symptom

I have a scheduled task that runs every morning to execute a basic VB script to perform a simple task. The majority of the servers running this scheduled task but one of the server will not able to complete the task. I have deleted the task, exported the XML, and re-added it from a working server, I have the local system as the run as user which we have set on every server as well but the task just will not complete. If we manually execute the VB script it works just fine but for some reason task scheduler will not finish. The server has been rebooted a few times in the past.

I also tried was switching the user that runs the task from the system to my domain login which provides elevated access but got the same result. I took the VB script off another server that works along with the task and imported them also got the same result. I have changed the run as to 2012 from 2008 just to test nothing.

The VB script has a proper termination, I have run this on over 50 servers but the problem just happens to the server installed with Windows Server 2012 R2.

Solved: How do I fix Windows Server 2012 R2 scheduled task hangs and never completes

Follow the below solution steps to resolve Windows Server 2012 R2 scheduled task hangs and never completes issue.

Solution

Issue fixed after added cscript //NoLogo in front of the actions command.