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

Windows 10
Windows 10
A Microsoft operating system that runs on personal computers and tablets.
11,086 questions
Access
Access
A family of Microsoft relational database management systems designed for ease of use.
333 questions
Access Development
Access Development
Access: A family of Microsoft relational database management systems designed for ease of use.Development: The process of researching, productizing, and refining new or existing technologies.
849 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Peter Doering 170 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