batch file to copy

?

_

Hi,

I want to write a batch file that copies some files only if they are newer
than those on the destination drive. Basically, it would compare the date
stamp on the file to be copied with the existing version on the destination
drive, and will execute the copy command to overwrite the existing files
only if the date/time on the files on destination drive is older than the
source files to be copied. Are there any environment variables related to
date/timestamps?

Thanks.
 
P

Phil Robyn

_ said:
Hi,

I want to write a batch file that copies some files only if they are newer
than those on the destination drive. Basically, it would compare the date
stamp on the file to be copied with the existing version on the destination
drive, and will execute the copy command to overwrite the existing files
only if the date/time on the files on destination drive is older than the
source files to be copied. Are there any environment variables related to
date/timestamps?

Thanks.

XCOPY /?
 
R

Ray at

Take a look at xcopy at the command prompt:

xcopy /?

Specifically look at the /D switch without a date value passed.

/D:m-d-y Copies files changed on or after the specified date.
If no date is given, copies only those files whose
source time is newer than the destination time.

Ray at work
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top