Batchfile help date time stamp

razaqad

Raza
Local time
Today, 22:41
Joined
Mar 12, 2006
Messages
83
I'm using a batchfile for backup of the Backend.

i'm using the following command to copy the backend folder to the desired location:
xcopy "E:\MyDB" "f:\Backups\MyDB\" /f /r /E /H /K /Y /I /C /D

I want that each time the back end to be copied witth a different name e.g Timt-DATE-MyDB

how can i do this using a batch file.
 
Well.... technically you can't. So here's how you do it anyway.

First, in your scheduler that runs the backups, run a macro out of your database (See /X command-line option of Access) just before you are about to back up your database. Have the macro run some code. Have the code create a .BAT file that looks like this little two-liner:

md f:\backups\mydb\db_timetag_bk\
xcopy "E:\MyDB" "f:\Backups\MyDB\db_timetag_bk\" /f /r /E /H /K /Y /I /C /D

Have the code delete the old copy of the .BAT file before it tries to create the new copy. Remember that the macro has to include a quit command when it is finished with the RunCode option.

Then just run that .BAT file from the command prompt with the AT command.
 
coz ... there are so many different front ends for the same db .... i can schedule it through windows task scheduler to run once a day or as desired ......
 

Users who are viewing this thread

Back
Top Bottom