如何对所有“你想覆盖吗"说不?批处理文件复制中的提示? [英] How to say no to all "do you want to overwrite" prompts in a batch file copy?
问题描述
默认情况下,从命令提示符复制会提示您覆盖目标位置中已存在的文件.
By default, copying from the command prompt will prompt you to overwrite files that already exist in the target location.
您可以添加/Y"来表示全部同意"替换.
You can add "/Y" to say "Yes to all" replacements.
但是你怎么能对所有人说不"呢?
But how can you say "No to all" ?
换句话说,我想从一个目录中复制不已存在于目标中的所有内容.
In other words, I want to copy everything from one directory that does not already exist in the target.
我看到的最接近的东西是 XCOPY 参数,它只在特定的 mod-datetime 之后复制东西.
The closest thing I see is the XCOPY argument to only copy things after a specific mod-datetime.
推荐答案
除非有一种情况,您不想要复制自上次复制以来已更改的源中的现有文件,为什么在不指定日期的情况下不要将 XCOPY 与/D 一起使用?
Unless there's a scenario where you'd not want to copy existing files in the source that have changed since the last copy, why not use XCOPY with /D without specifying a date?
这篇关于如何对所有“你想覆盖吗"说不?批处理文件复制中的提示?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!