T
Tony_VBACoder
I am trying to write a DOS Batch File that will compact/repair an Access 2000
MDE file (I have referred to the following KB article:
http://support.microsoft.com/default.aspx?scid=kb;en-us;209207). The 2 step
process of my batch file is to:
1) Check for the existence of the .LDB file and delete it if it exists
2) Compact the MDE file
I have created a Scheduled Task in Windows 2000 Server that will run this
Batch file each day at 6am.
My batch file code is listed at the end of this post. The problem I am
having is, after the Delete code runs, my compact code does not execute.
However, if I go into my Scheduled Task and change my "Run" command from my
Batch file to the following text "C:\MyFolder\MyApp.mde /compact", the
compact process runs fine.
Can someone tell me what I am doing wrong in my batch file?
---- BATCH FILE CODE BELOW ---------------------------
REM: 1st - check if the file exists before deleting it.
IF EXIST c:\MyFolder\MyApp.ldb del c:\MyFolder\MyApp.ldb
REM: Now run the Compact/Repair on the MDE file
C:\Program Files\Microsoft Office\Office\MSACCESS.EXE C:\MyFolder\MyApp.mde
/compact
MDE file (I have referred to the following KB article:
http://support.microsoft.com/default.aspx?scid=kb;en-us;209207). The 2 step
process of my batch file is to:
1) Check for the existence of the .LDB file and delete it if it exists
2) Compact the MDE file
I have created a Scheduled Task in Windows 2000 Server that will run this
Batch file each day at 6am.
My batch file code is listed at the end of this post. The problem I am
having is, after the Delete code runs, my compact code does not execute.
However, if I go into my Scheduled Task and change my "Run" command from my
Batch file to the following text "C:\MyFolder\MyApp.mde /compact", the
compact process runs fine.
Can someone tell me what I am doing wrong in my batch file?
---- BATCH FILE CODE BELOW ---------------------------
REM: 1st - check if the file exists before deleting it.
IF EXIST c:\MyFolder\MyApp.ldb del c:\MyFolder\MyApp.ldb
REM: Now run the Compact/Repair on the MDE file
C:\Program Files\Microsoft Office\Office\MSACCESS.EXE C:\MyFolder\MyApp.mde
/compact