I have written a short batch file to copy the most current version of a database from a common “library” drive (L:) to the users “user” drive (G:) then open the file in MS Access. The code works fine except it never sees the “exit” command so the cmd prompt window never closes.
I am thinking it has to do with the ‘environment’. I have tried several variations of ‘setlocal’ and ‘endlocal’ but haven’t made it work so I could be wrong about that.
Here is the entire batch file (running fromthe g:\ALDS directory – that is a requirement)
1) xcopy L:\ALDS\Support\ALDSEntry.mdb G:\ALDS\ALDSEntry.mdb /Q /K /Y /D /Z
2) “c:\Program Files\Microsoft Office\Office\MSACCESS.EXE” G:\ALDS\ALDSEntry.mdb
3) exit
(I have inserted line numbers above for clarity. They do not exist in the batch file.)
I am running XP but my client is running Win2000 Professional. So far everthing has been compatible so if it doesnt work I ass-u-me it won’t work there.
Anybody know how to make the thing close?