Search code examples
batch-filecmdcopyxcopy

How to copy files more than once into the same folder


Say I have a file, file.txt and I want to copy it into this folder, d:/Folder1, except I need it more than once. When I go CTRL+C the file, it goes file - Copy.txt but when I try to use copy in batch, it says I cannot overwrite the file.

How do I make it is it copies more than once into that folder?


Solution

  • This batch file will make 100 copies starting at file1.txt to file100.txt

    @echo off
    for /L %%a in (1,1,100) do copy /b "c:\folder\data\file.txt" "d:\folder1\file%%a.txt"