if someone does shut down illegally will/can the db on the shared drive still get corrupt?
Possibly. Just ask Murphy.
In case you don't know, I'll go over each line:
REM Turns off local echo of the DOS commands as they're executed.
[red]@echo off [/red]
REM Creates a directory (folder) on the local Hard drive. If folder already exists, will generate an error, but continue anyway.
[red]mkdir c:\local_dir [/red]
REM Copies the named file from the network shared directory to the (new) directory on the users local drive
[red]copy "\\compname\shared_dir\db.mde" c:\local_dir [/red]
REM kicks off Access and loads the file just copied
[red]start "c:\program files\microsoft office\office\msaccess.exe" c:\local_dir\db.mde [/red]
The problem with this batch file is that the user will be prompted EACH TIME after the first run of it, whether or not to OVERWRITE the file that's already in the new directory from last time they ran the copy. Annoying, but not a deal-breaker.
You can put this batch file pretty much anywhere, in the ROOT of C:\, in the C:\PROGRAM FILES folder, even on the desktop itself.. Place a shortcut to it on the desktop, and then change these properties for it, to make it a little cleaner:
1) Right click the shortcut icon, and select PROPERTIES
2) Look for the RUN option, and set it to run MINIMIZED. Cuts down on screen clutter.
3) Also, look for the option for "Close on Exit" and make sure it is checked ON - this will destroy the instance of DOS that the batch file started, cause you don't need it any more once the batch file has run. It wouldn't hurt to add the line
QUIT to the end of the batch file either...
Ex-JimAtTheFAA
78.5% of all statistics are made up on the spot.
Another free Access forum:
More Neat Access stuff at