[AccessD] Add Date/Time Stamp to xcopy target

Brad Marks BradM at blackforestltd.com
Thu Apr 14 16:43:22 CDT 2011


Rocky,

I am sure that there are many ways to do this.  Here is the technique
that I have been using for a couple
years with no problems.

Brad

;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~
; This script uses a free Open Source tool called AutoHotKey
www.autohotkey.com
;  
; This script copies a file to a new file that has a date-time stamp in
the file name
; 
; Here is an example file name that was created with this script 
;
; C:\MyFile_Date_2011-04-14_Time_16-27-01.txt  
;
;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~


FormatTime, Date_String,,  yyyy-MM-dd    ;;; Format a string called
Date_String

FormatTime, Time_String,,  HH-mm-ss      ;;; Format a string called
Time_String

Date_Time_String = Date_%Date_String%_Time_%Time_String%   ;;; Build a
string called Date_Time_String

Filecopy, C:\MyFile.txt, C:\MyFile_%Date_Time_String%.txt  ;;; Copy the
file to a new file with Date Time in Name


;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~  END
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~






-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin
Sent: Thursday, April 14, 2011 3:05 PM
To: 'Access Developers discussion and problem solving'
Subject: [AccessD] Add Date/Time Stamp to xcopy target

Dear List:
 
Client wants to do regular backup to his EHD using Windows Scheduler.
He's
almost there but has a question:
 
The following in a batch file seems to work for backing up DocketWorks: 

 

xcopy "W:\DWData.mdb" "C:\ProgramData\DocketWorks"

 

Do you know if there is some way to append a date time stamp to it so it
does not always overwrite the previous backup? 

Anyone know?

 

TIA

 

Rocky

 

-- 
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com

-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.





More information about the AccessD mailing list