使用 xcopy 并行复制
我需要将多个目录从一个位置复制到另一个位置。因此,将会有多个 xcopy
语句,一个接一个。
每个文件夹中的文件数量都很大。有什么方法可以并行运行这些 xcopy
语句吗?我能想到的一个选择是 - 在单独的批处理文件中调用每个 xcopy
,并使用 @start
而不是 @call
调用这些批处理文件。
还有其他选择吗?
I need to copy multiple directories from one location to other. So, there are going to be multiple xcopy
statements, one after another.
The number of files in each of the folders is huge. Is there some way by which I can run these xcopy
statements in parallel? One option I can think of is- call each xcopy
in a separate batch file, and call those batch files using @start
instead of @call
.
Is there any other alternative?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以直接启动 xcopy,如下所示
start xcopy [parameters]
。这允许您并行运行许多 xcopy 实例。顺便问一下:你尝试过 robocopy 吗?它包含在所有最新的 Windows 版本中,并提供比 xcopy 更多的选项(有时还提供性能)。
但一般来说,并行复制多个目录速度较慢(至少当您从一个驱动器复制到另一个驱动器时),因为它会强制源驱动器在并行复制作业之间查找,而不是顺序读取文件。
You can start xcopy directly, like so
start xcopy [parameters]
. This allows you to run many xcopy instances in parallel.By the way: Have you tried robocopy? It's included in all recent Windows versions and offers more options (and sometimes performance) than xcopy.
But in general copying multiple directories in parallel is slower (at least when you copy from a drive to another drive), because it'll force the source drive to seek between the parallel copy jobs instead of reading files sequentially.