有没有一种方法可以创建、复制一个源文件,并在目标中拥有同一文件的多个副本?这样它就会重新命名自己。
copy "C:\Users\User\Desktop\file.txt" "C:\Users\User\Desktop\copy.txt"
copy "C:\Users\User\Desktop\file.txt" "C:\Users\User\Desktop\copy.txt"
copy "C:\Users\User\Desktop\file.txt" "C:\Users\User\Desktop\copy.txt"
等,但这会给出一个错误。我可以在目的地名称中使用通配符吗?有什么能纠正这个问题的方法吗?
发布于 2015-09-10 17:27:52
我不确定我是否理解正确。你想把file.txt
复制到桌面上10次,然后把新文件命名为copy1.txt到copy10.txt?在这种情况下,这将起作用:
SET source=C:\Users\User\Desktop\file.txt
SET dest=C:\Users\User\Desktop\copy
FOR /L %%i IN (1,1,10) DO (
copy %source% %dest%%%i.txt
)
https://stackoverflow.com/questions/32496723
复制相似问题