amateur
amateur

Reputation: 44605

task in task scheduler failing when executing batch file

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?

Upvotes: 2

Views: 12009

Answers (3)

Thorsten Hüglin
Thorsten Hüglin

Reputation: 1307

Check the Security options of your Task. Make sure, the option Run whether user is logged on or not is selected.

Upvotes: -1

Jeff Davis
Jeff Davis

Reputation: 4797

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.

Upvotes: 3

PaulH
PaulH

Reputation: 41

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.

Upvotes: 4

Related Questions