This will copy an MSAccess2K database and perform a repair and compact on the database. The script will run every Friday at 3 PM. This is very useful for backup and maintaining a database.
############################################
# This script will backup, rename, repair and compress an MS Access 2000 database
# then copy back the compressed database over the original database.
# Updated 11/02/2001 by Don Barton. You may use and modify this script for any and all purposes.
{
-name MSACCESS backup
-start 09/31/01 3:00 PM -constrain 0 0 5 0
-stop 12/31/06 12:00 PM
-skip -week 1 2 3 4 6 7
# Initial beep signals script is starting
-action -beep 48
-action -print Copying database to backup directory
-action -copy "C:\Databases\MyDatabase.mdb" "C:\DatabasesBACKUP\MyDatabaseUC.mdb"
-action -print Database copied successfully
-action -print Repairing and Compacting Database
-command -wait "C:\Program Files\Microsoft Office\Office\msaccess.exe" "C:\DatabasesBACKUP\MyDatabaseUC.mdb" /Compact C:\DatabasesBACKUP\MyDatabaseC.mdb
-action -print Finished compact and repair
-action -print Compacted database being copied to current
-action -copy "C:\DatabasesBACKUP\MyDatabaseC.mdb" "C:\Databases\MyDatabase.mdb"
-action -print Database in main directory has been updated
# Second beep to signal script is ending
-action -beep 48
-inc 1 0 0 0
}
############################################
Don
_________________________
Don Barton