Task Scheduler won't launch Access database

Darrell Burns 141 Reputation points
2023-03-10T14:27:19.0733333+00:00

I've created a task in the Windows Task Scheduler that should launch an Access database (accdb) from a .bat file at 5:15AM every day. The Access database has an AutoExec that calls a Startup process that checks the command line to see if it's being called from the nightly schedule. If so, it then runs a bunch of queries that take approximately 75 minutes to complete.
When I launch the bat file directly, everything works fine. However, when launched from Task Scheduler it shows that the action was triggered and that the task is "running", but actually it isn't. The following screenshots show the setup and the launch. What am I not understanding?

Task_Scheduler_1

Task_Scheduler_2

Microsoft 365 and Office | Access | Development
Windows for business | Windows Client for IT Pros | User experience | Other
Microsoft 365 and Office | Access | For business | Windows
{count} votes

1 answer

Sort by: Most helpful
  1. Peter Doering 190 Reputation points MVP
    2023-03-11T01:12:55.5833333+00:00

    Viorel is correct with regard to scenario not being supported. However, technically it should still work. In your bat-file you have to provide the full path to Access and then path\file of your accdb.

    Example:

    "C:\Program Files (x86)\Microsoft Office\root\Office16\MSAccess.exe" "C:\Access\SCM_update.accdb" /cmd Nightly

    (all in one line, separated by spaces)

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.