Why won’t Task Scheduler run my .bat file?

I had a .bat file that ran the SQL Azure Migration Wizard Batch Backup utility. When I double clicked or ran the.bat in a command window it worked. When I scheduled the task to run the Task Scheduler reported the task completed, but it clearly had not run. What was going on?

It turns out that in the Task Actions dialog I had set ‘Program/script’ to (not unsurprisingly) point to the script:

cmd /c c:\SqlAzureBackup\BackupDatabase.bat

When really what I needed was:

Program/script: cmd
Add arguments: /c BackupDatabase.bat
Start in: c:\SqlAzureBackup\

= solved.



  1. Thanks this helped a lot. Tom

  2. Ethan · · Reply

    Thanks. Was helpful.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: