Board logo

标题: 用批处理判断两个文件的新旧 [打印本页]

作者: qpmgljf     时间: 2009-12-7 16:20    标题: 用批处理判断两个文件的新旧
各位师傅:

请问如何用批处理来判断两个同名文件的新旧?
比如我U盘上有一个offline.rar 文件,在h盘上的abc文件夹下也有一个offline.rar文件,如何判断这两个文件的新旧,如果h盘上的文件较旧,则用u盘上的替换之。

作者: 48344620     时间: 2009-12-7 21:29
xcopy /d
xcopy /?

作者: fujiang1000     时间: 2009-12-17 17:25
/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.

作者: xiaxueyiyi     时间: 2010-2-1 16:44
/D:m-d-y 复制在指定日期或指定日期以后更改的文件。
如果没有提供日期,只复制那些源时间
比目标时间新的文件。