Windows – How to run an Access script using windows task scheduler

scheduled-taskstask schedulerwindows-server-2008-r2

I have a VM running Windows Server 2008 R2 Enterprise and want to use the Task Scheduler to run an Access script. This script will do some stuff and then close. I've already written and tested the command line in a batch file and it works perfectly:

"C:\Program Files (x86)\Microsoft Office\Office14\MSACCESS.EXE" "C:\MyPath\Mydb.accdb" /x "MyMacro"

I've also created a task in the scheduler. I think it opens up the MSACCESS.EXE and passes the other 2 parts of the command line as arguments.

However, when I manually run this in the scheduler, nothing happens. According to the logs, the task is started and then nothing. Looking in the Task Manager, I don't see Access running.

Did I set up the task wrong? The last task scheduler I used was Windows XP (which was very simple compared to this).

Edit

I've also tried this without the arguments, just using "C:\Program Files (x86)\Microsoft Office\Office14\MSACCESS.EXE" for the action. I would expect Access to open, but still nothing happens.

Best Answer

I believe you must select "Run only when user is logged on" in your Windows Task Scheduler Job Properties. You must also be logged on to automatically have scheduled Access macros run.

This really seems like a huge limitation of Access, but I have not seen another solution out there. It would be great to have a solution for running an Access macro while logged off.

Related Question