批处理命令将文件移动到两个位置

时间:2016-04-12 12:51:16

标签: batch-file

如何将文件从一个位置(源)移动到两个位置(target1和target 2)?

我在下面写了一个批处理,但它只移动到文件夹target1,而不是第二个文件夹target2。

@echo off 移动/ -y“c:\ source * .wav”“c:\ target1 \” move / -y“c:\ source * .wav”“c:\ target2 \”

请帮忙。

1 个答案:

答案 0 :(得分:0)

您需要复制到第一个位置,然后移到第二个位置。移动到第一个位置后,没有原始源文件移动到第二个位置!

copy /y "c:\source*.wav" "c:\target1\" && move /y "c:\source*.wav" "c:\target2\"