Batch File to Start DB

JC3

Registered User.
Local time
Yesterday, 21:08
Joined
Jun 13, 2005
Messages
53
Hi

I want to use a batch file to start the DB. This will check if the Front End is on the users machine and if not copy it over.

It will then check what version of Access they are running and use the appropriate shortcut to open the Database.

This all works fine except that the Batch File does not close down until the Database is closed. Is there anyway to close the Batch File automatically while the database is running?

The Batch file I am using is

Code:
@echo off
rem *************************************
rem ** Batch file to copy FE **
rem *************************************

rem ** Copy Database **

if not exist "c:\DB\" md "c:\DB" 
if not exist "c:\DB\FE.mdb" copy "NetworkPath\FE.mdb" "c:\DB\FE.mdb"
if exist "C:\Program Files\Microsoft Office\Office10\MSACCESS.EXE" goto Office10
if exist "C:\Program Files\Microsoft Office\Office11\MSACCESS.EXE" goto Office11
if exist "C:\Program Files\Microsoft Office\Office\MSACCESS.EXE" goto Office

:Office10
"C:\Program Files\Microsoft Office\Office10\MSACCESS.EXE" "c:\DB\FE.mdb" /WRKGRP "NetworkPath\Secured.mdw"
goto End

:Office11
"C:\Program Files\Microsoft Office\Office11\MSACCESS.EXE" "c:\DB\FE.mdb" /WRKGRP "NetworkPath\Secured.mdw"
goto End

:Office
"C:\Program Files\Microsoft Office\Office\MSACCESS.EXE" "c:\DB\FE.mdb" /WRKGRP "NetworkPath\Secured.mdw"
goto End

:End
Exit

Any ideas?

JC
 
Instead of running it directly, try using the START command and do not specify the WAIT flag.
 
I have tried adding the start command to the beginning of the line but now it does not seem to be reading the Workgroup file for security.

Any ideas?
 
You could use a VBS script file or better yet create a VB.exe file if you have Visual Basic installed [not VBA] to create executable files. Search around for I have seen VBS script threads [maybe not here] that will do what you want and use can create them using notepad.exe.
 
Did you enclose the WHOLE command line in double quotes? As opposed to breaking them up as in your example?
 

Users who are viewing this thread

Back
Top Bottom