Duplicate file or floder x times with command Line

ometimes there might be a need to make multiple copies of the same file. Normally in order to make a copy of a file, one would have to open the file and click “Save As” on the Menu to the save the file in a different name. The key to having multiple copies of a file is to make sure that each file is named differently otherwise they will overlap.

Fortunately this can be done quite easily by writing some commands on the Command prompt of Windows.

Steps

  1. Create a Folder where you want to save the files.
  2. Save the File in the Folder for which you want to make multiple copies.
  3. Name the File as “cat” . For Example cat.jpg
  4. Open the Command Prompt withe CMD
  5. Change your directory to the location of the folder
  6. And then type this command
for /l %f in (1,1,5) do copy cat.pdf cat%f.pdf

On the command above “5” is the number of copies to be made. Substitute that with the number of copies you would actually need.

This is how it appears Initially. There is a Text Document named “1” on a folder.

Leave a Reply

Your email address will not be published. Required fields are marked *