I’ve been using Windows Task Scheduler for quite some time now, especially with Microsoft Access Databases to trigger them to run at a specific time. I recently switched over to a box running Windows 7 and when it came time for me to migrate some MS Access Databases over I thought it would be fairly seamless…Was I in for a surprise!

In Windows 7, it isn’t the most glaring thing to figure out how to open a MS Access Database with Task Scheduler. In the task scheduler menu it gives you three options; Start A program, Send an e-mail, and Display a message. This all seems fine and dandy, but I got to thinking on how to open a file with Task Scheduler in Windows 7?
[center-ad]

[styled_image w=”250″ h=”270″ lightbox=”yes” align=”right” image=”http://robertmcquaig.com/wp-content/uploads/2013/02/TaskScheduler.png”]After much thought, I figured I’d just set it to “open a program” and just go from there. NOPE! I must have spent a solid hour and 100 Google searches trying to figure out how to open a MS Access Database through Windows 7 Task Scheduler with minimal luck. I did however come across some information that lead me to look in to a batch file, since I knew you could use Task Scheduler to run a batch, I figured this just made sense. So after a couple seconds whipping up a quick and dirty batch to open my MS Access Database, I had this thing working in no time.

I can’t determine why Task Scheduler was having issues opening an MS Access Database, so I’ll leave that to the super-guru’s to figure that out. For me though, I got it working using this method and seems to not have any issues. One thing though is that the Access Database will run in the background, this is fine as long as it does its job. So just keep this in mind, and if you don’t trust me then open up your task scheduler and you’ll see the processes running. Just remember that with using a batch method your file will not exit on it’s own, nor will the command prompt window. So remember to add a line in your batch to exit and some code to close out your Access Database such as docmd.quit

If you need an example of a sample batch file to open a MS Access Database, here you go:

Tags: