仅批量复制新文件

时间:2010-08-17 05:12:54

标签: batch-file

我查看了copy和xcopy批处理命令。它们似乎都不支持“只复制新文件而不管文件日期时间 - 仅比较名称”选项。请指教。

3 个答案:

答案 0 :(得分:7)

看看ROBOCOPY。使用以下开关调用它将递归复制source_dir中尚不存在的destination_dir中的文件:

robocopy source_dir destination_dir /s /xc /xn /xo

Als查看RoboCopy Manual以获取有关开关的说明。

答案 1 :(得分:1)

/D

 /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.

修改 new 是什么意思?

答案 2 :(得分:0)

也许你应该看看rsync。它有一个Win32端口,它可以根据许多考虑因素复制文件,包括目的地是否存在或不同。

我想你想要转换:

--ignore-existing       skip updating files that exist on receiver
相关问题