Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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.

share|improve this question
    
Have you set the Action as Start a Program? –  Yassar Sep 13 '13 at 16:30
    
@yassarikhan786, yes. –  PowerUser Sep 13 '13 at 17:03
    
In which user context does the scheduler run the MS Access? Does that user have sufficient access rights to the .accdb file? –  Michał Sacharewicz Sep 13 '13 at 20:29
    
I am using my own user account and "run with highest privileges" is checked. Also, I can successfully run this command line from a batch file. –  PowerUser Sep 13 '13 at 21:30
    
The History tab seems to always stop at Event#129:"Created Task Process". –  PowerUser Sep 13 '13 at 21:33
show 5 more comments

1 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.

share|improve this answer
    
I don't recall if I did that or not. In the end, I gave up on the VM and just had a user run the script as needed. In hindsight, this turned out to work better for us than my original VM attempt. –  PowerUser Jan 31 at 18:40
    
Ok, thanks for the note. –  Mister_Tom Jan 31 at 18:57
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.