Batch file or copy and rename files in different drive/directory

mcquicker

Distinguished
Oct 12, 2010
2
0
18,510
0
Problem:

I have a batch file that copies files from one source drive/directory to a target drive/directory.

I would like, however, for the batch commands to copy the same files but, instead of replacing in the target drive/directory, to add the files with a number, so I can go back and retrieve changed information from previous files, if necessary. E.g. - I copy textfile.txt, then when I copy the file again, instead of replacing it, it leaves the original file in place, and copies the newer file with a _01 added, etc.

textfile.txt
textfile_01.txt
textfile_02.txt

Many thanks in advance
Peter
 
Although it might be possible to do that with a batch file (if you are well versed in Microsoft scripting language), what you want is implemented by a specialized backup software, where history of files is maintained. On most such apps, you can configure how long the backups are retained, how often they are performed, things like that.

If you still need to use batch files - why not backup to separate folders for each day?
 
Thread starter Similar threads Forum Replies Date
David___Only Apps General Discussion 0
S Apps General Discussion 4
M Apps General Discussion 3
D Apps General Discussion 2
N Apps General Discussion 1
NoctisLionward Apps General Discussion 2
malavena Apps General Discussion 3
Tom Waller Apps General Discussion 2
P Apps General Discussion 1
S Apps General Discussion 4
A Apps General Discussion 13
Z Apps General Discussion 1
P Apps General Discussion 7
G Apps General Discussion 0
T Apps General Discussion 5
deadmuse Apps General Discussion 1
A Apps General Discussion 3
U Apps General Discussion 1
C Apps General Discussion 5
H Apps General Discussion 9

ASK THE COMMUNITY