Using XXCOPY in DOS Batch File, And...
Posted on 2010-01-12
I am using xxcopy right now to move files that are a year and older to another location. It retains the directory structure at the source and creates it correctly at the destination. It successfully moves the files from source to destination based on the file creation date. It also retains the directory structure. That's great!
However, I have not been able to figure how I set it up so that if the file with the same name exists on both the source and destination to not overwrite the destination but simply rename the file and move it in the same location. For example, if a file is named " test.txt", and it exists within the same directory at both the source and destination it should not overwrite the destination file test.txt and simply rename the file at the destination as test1.txt or test-1.txt, etc. So I need to retain the different file versions without simply overwriting them.