task in task scheduler failing when executing batch file

11,759

Solution 1

My workaround is to call a .BAT file from the Task Scheduler.

This batch file then calls the PowerShell script file:

powershell c:\dir1\AutoPopulate.ps1

Seems to work.

Solution 2

I have run into this a few times. Check the last run result on the task. If it says another instance is already running, right-click on the task and click "End." Then after it ends the task it should start again correctly the next time. You can also right click and choose "Run" to run it immediately.

Share:
11,759
amateur
Author by

amateur

Updated on June 04, 2022

Comments

  • amateur
    amateur almost 2 years

    I have a task set up on a windows server 2008 R2. This task is setup in the task scehduler to execute a batch file that backs up a mongo database, every 4 hours. I have it set up the same on 2 servers.

    On 1 server it runs fine.

    On the other, I get this error logged in the history and it doesn't execute.

    Task Scheduler failed to start "\Backup MongoDb" task for user "*****". Additional Data: Error Value: 2147750687.
    

    I am lost for ideas what the issue may be. Anyone got any ideas?