Ok, been a while since I last posted. This quarter I was really trying to revamp my processes to focus on getting billable stuff done. So my writing took a bit of a back seat while I tried to figure it out.
Last week and this week I had 2 different clients that I had set up Scheduled Tasks to run Access on a regular basis to run reports, send emails, and various other things that needed to be done. I originally used Access for this because they generally all involve dealing with Access databases and queries and things that were simple to do in Access but more difficult to do in other scripting languages. I needed the Access reports anyway.
So long ago I worked up a way to make sure Access would run and then shut down cleanly in a consistent way. Access is a bit more sensitive to hanging and crashing if you are running it without being on a user’s desktop. The only issue I still had was that occasionally if the power went out or some unexpected error happened, Access might crash and this would create a hung process and each time the task is scheduled to start it would spawn a new instance. Eventually this would crash the computer.
I discovered the reason for this was because Access was waiting to see if the non-existent user wanted to run in safe mode, or in some instances just said Access crashed badly when you ran the database last, are you sure you really want to run it again?
Once I logged in and manually ran the process it would ask me the question, I’d say Yes, or No, and it would continue on it’s merry way and I could restart the scheduled task again.
So the question was, how do you prevent Access from asking that question? Turns out Access stores info about the database that crashed in the registry in a couple spots which triggers the questions. So I added these statements to the beginning of the batch file that launched the access program (this is specific to the version of Office I’m running as you’ll see in the registry key names):
REG DELETE HKEY_CURRENT_USER\Software\Microsoft\Office\16.0\Access\Recovery /va /f
REG DELETE HKEY_CURRENT_USER\Software\Microsoft\Office\16.0\Common\CrashPersistence\MSACCESS /va /f
These statements delete anything in and under those nodes (/va) and force (/f) the deletion.
You might need to do some research and digging around if you have a different version of Access, but this works with the latest build of Office 365 Access as of November 2025.