How do I create a batch file to copy a file and if the destination already has the file it will add a number extension to it's name

Joined
Apr 4, 2021
Messages
1
Reaction score
0
How do I create a batch file to copy a file and if the destination already has a file with the same name it will add a number extension to it's name and complete the copy. Thus in that scenario I would have 2 files in the destination, one with the original name and one with the original name plus a number.

My goal is I want to keep the original file backup copy and all following backup copies.
 
Last edited:
Joined
Jul 29, 2017
Messages
14
Reaction score
0
Every time you make a copy just give it the next number i.e., if there are two files there will be 1 and the next will be 2 and the one that you want to be copied just put 4, so you have all of the versions and the last one is your final copy until you add another one to it.

I was a secretary and still use the system that you are referring to, but in my case, unless those copies will be needed again I only keep the last copy and when I get the message do you want to replace I say yes.

I do understand though that we sometimes have to keep all versions of the copies as I had to when I was a Legal Secretaries.

I hope that this helps.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top