/compact is actually a command-line switch for msaccess.exe, so you need to
include that in your command line as well.
The actual command you need will depend on what version of Access you're
running (or, more accurately, where msaccess.exe is installed on your
machine), but it will take the form of:
"C:\Program Files\Microsoft Office.11\OFFICE11\msaccess.exe"
K:\User\Aggregates\Live\Deductibles\NF_Catlin_Exposure_Management_1.2.mdb
/compact
(all on one line, of course)
Note that you need quotes around the full path to the executable, since
there are spaces in the path name.
Also, you may want to take advantage of the fact that you can compact to a
different file. I'd create a batch file that renames the existing file and
compacts the renamed file to the "proper" file name. If something goes wrong
during the compact, you could end up hosing your database.
--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no private e-mails, please)
"Phil Davy" <(E-Mail Removed)> wrote in message
news:7236BF15-FECC-4630-BE1C-(E-Mail Removed)...
>I have got a scheduled task set up designed to compact and repair my
>database.
>
> In the Run box I have entered the following text:
>
> K:\User\Aggregates\Live\Deductibles\NF_Catlin_Exposure_Management_1.2.mdb
> /compact
>
> I took the syntax directly from Access help.
>
> However when the task runs all it does is open the database without
> actually
> compacting it.
>
> Could anyone please help?!
>
> Thanks in advance.