In alt.msdos.batch.nt foxidrive wrote:
> On 29 Jun 2006 04:44:03 -0700, (E-Mail Removed) wrote:
>
>> whats the easiest way to do this?
>>
>> Basically, what I want to do is compare the dates of two files
>> (call them file1 and file2). If file2 has a more recent date
>> than file1, then
>>
>> file2 should overwrite file1.
>>
>>
>> The application we run has got a sort of scheduled jobs thing
>> so we will be using this. It can execute a dos batch file or
>> any executable. If its easily done in a dos batch file this
>> would be easy I guess.
>
>
> @echo off
> xcopy "c:\file2.ext" "d:\file1.ext" /d /y
Other notes:
the obscure REPLACE.EXE command for some conditions
DIR /O

if using a sensible Date format such as YYYY-MM-DD
may be useful in some conditions.