ajetrumpet
Banned
- Local time
- Today, 08:56
- Joined
- Jun 22, 2007
- Messages
- 5,637
I have recently created a small batch file that performs a back-up of files to a USB drive. What I am trying to do now is only pick out the files from my source directory that have been modified since the last backup. The backup is performed every week.
From testing the files in the source directory, I know that opening them alone does not create a new timestamp for the LastModified property of the file. Additionally, data changes within the files are not necessary to update the timestamp. I tested this by opening various files and just pushing the save button without performing any additional movements. This alone update the LastDateModified to the current.
To perform the current backup (which happened today), I used the following switches and parameters with the XCOPY command from the source directory:
This copies only the files that were modified on or after 5-19-08. I found the following code on a website regarding the specification of previous dates (similar to the DateDiff() function in VB):
I have no idea what this means, or if it was only valid for a specific version of DOS.
Basically, in VB terms, I would like syntax that performs an operation similar to the following mix of DOS and VB syntax (using VB here for the DOS stuff I don't know how to write):
From testing the files in the source directory, I know that opening them alone does not create a new timestamp for the LastModified property of the file. Additionally, data changes within the files are not necessary to update the timestamp. I tested this by opening various files and just pushing the save button without performing any additional movements. This alone update the LastDateModified to the current.
To perform the current backup (which happened today), I used the following switches and parameters with the XCOPY command from the source directory:
Code:
/s/d:5-19-08
Code:
DestinationDirectory /DA#7
Basically, in VB terms, I would like syntax that performs an operation similar to the following mix of DOS and VB syntax (using VB here for the DOS stuff I don't know how to write):
Code:
XCOPY SourceDirectory/s/[I]DateLastModified >= DateDiff("d", 7, Date()) DestinationDirectory[/I]