Take the 2-minute tour ×

We have a folder to which a lot of people copy files. Instead of over writing the existing file on the folder, I would like to rename the original file first, and then copy the new file.

Example: If I copy a file myFile.txt (which is already present in the folder), it should save the existing file as myFile_backup.txt and copy the new file as myFile.txt.

Is this possible?

share|improve this question
What would happen the following time the back up run - would you want to add a number for each time the back up run (eg myFile01.txt, myFile02.txt) - you will end up with a massive folder. –  Dave Sep 24 '12 at 8:56
Hi Dave, Thanks a lot for your response. I just need to have one backup version. At any instance after the 1st copy, I will only have myFile.txt and myFile_backup.txt. Thanks! –  Anand Sep 24 '12 at 9:12
So, on the third time the back up runs (where you have myFile and myFile_backup) what happens. Does myFile overwrite myFile_backup ? –  Dave Sep 24 '12 at 9:22
Yes. myFile overwrites myFile_backup. I just want to have one previous version of the file as a backup. Also, is this function valid only for a session? When I exit and comeback, it tells me copyFileToFolder does not exist. I am very new to this thing so sorry for asking such basic questions. –  Anand Sep 24 '12 at 9:33
The default behavior for Windows 7 is to prompt the user what to do when a file with the same name appears in a folder being copied to. My suggestion is to inform everyone of this behavior. –  Ramhound Sep 24 '12 at 10:58

Your Answer



Browse other questions tagged or ask your own question.