I am working on a batch file to create an automated archived backup that I will schedule every 2 hours to run. It works until it gets through to the end of the script. Then I get the error 'A duplicate file name exists, or the file cannot be found.' What is wrong with me?
copy file.txt backup
if exist file4.txt ren file4.txt file5.txt
if exist file3.txt ren file3.txt file4.txt
if exist file2.txt ren file2.txt file3.txt
if exist file1.txt ren file1.txt file2.txt
if exist file.txt ren file.txt file1.txt