Task launch failed, instance already running

I am trying to launch a task from task scheduler. The task is executing a batch file. It is running for the first time but after that it's status is not getting changed from Running to Ready. It is running at an interval of 1 hour for 12 hours. I have tried creating the task from scratch, but could not solve it. I cannot go for the hotfix solution also. Kindly suggest me some other ways out.

Note: The solution is not getting any kind of exceptions as well, because it would have been logged in the log files.

Please help. Thanks in advance.

2 Answers

It can happen that a task that runs as scheduled task simply does not terminate. Whether this is a fault of task manager or the script is unknown, but both can be at fault here. For example, if the batch file contains a pause statement, the batchfile expects a keypress to continue. The task scheduler will never send it, and this the script never finishes.

That being said, I've seen occasions where a task finishes normally, yet task scheduler does not recognize this to be the case. The script terminates normally, yet task manager claims its still running.

For this reason, Microsoft enabled the option to terminate a task after x hours if its still running.

So what you want to do is edit the task, go to the settings tab and find the Stop the task if it runs longer than 3 days and change this to 1 hour.

At the bottom, you will find: If the task is already running, the following applies: Do not start a new intstance.

Change this to Run a new instance in parallel.

Notice that this option has the ability to kill the previous task or queue. I deliberately choose not to utilize this method.

Now, once you save the settings, right click the task and choose stop to stop the running instance.

Keep in mind, if the script really is at fault here, it may be the case that it does not run normally and thus whatever it is supposed to do never is being done. For example, if you run your script without task scheduler and it works, and does some stuff on network shares, and now you configure to do this with task scheduler, but you run it with higher privileges, it may simply not have access to the network shares and fails for that reason. That should however terminate the script normally though.

6

I am also facing the similar issue, so i have got the solutions that multiple users are connected the same user or NAS drive, i have logoff all the user from server and scheduler starts working

1

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like