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

12 Sep

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.

About these ads

One Response to “Why won’t Task Scheduler run my .bat file?”

  1. thomasharrisaz February 25, 2012 at 8:09 pm #

    Thanks this helped a lot. Tom

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 )

Twitter picture

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

Facebook photo

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

Google+ photo

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

Connecting to %s

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: