Link to home
Create AccountLog in
Avatar of joeserrone
joeserrone

asked on

MS Access Command Line Compacting

I recently had a similar dillemma like the one posed in:

Expert-Exchange Post

I followed the suggestio of build a shortcut with this target:
"Full Path To MSACCESS.EXE" "Full Path to your Database" /compact

Then set the Task scheduler to run that shortcut. The problem I found is that when the Task Scheduler runs it simply opens MS Access and doesn't run the compact function. If however I click on the shortcut on my desktop I can see the database compacting and then closing... Any suggestions on how to get this to work with the Task Scheduler ?
 
ASKER CERTIFIED SOLUTION
Avatar of Jim Dettman (EE MVE)
Jim Dettman (EE MVE)
Flag of United States of America image

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
Avatar of joeserrone
joeserrone

ASKER

Great that worked like a charm, what happens if I have multiple compacts to be performed... should I create a batch file for each database and set up the task scheduler to run them all at one time or is there a way to add multiple files to the batch file.
<<Great that worked like a charm, what happens if I have multiple compacts to be performed... should I create a batch file for each database and set up the task scheduler to run them all at one time or is there a way to add multiple files to the batch file. >>

  You can do it either way or do a single batch file for each DB, then use one batch file to call each.  Task scheduler then shows only one entry "Compact all DB's", but you still have the individual batches files that you can execute manually or through task scheduler as needed.

  You might also want to take a look at FMS's admin tool:

www.fmsinc.com

  Which does that backups, etc.  with a user friendly interface.  There are others out there as well.

JimD.