Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
If I use xcopy and it found files of the same name, but i don't want to overwrite but automatically rename the file,is it possible?
Glad if you could help

You mean in case you're coping a file and a file with the same name exists on the destination, then the file should be renamed to another name, e.g. file.txt would become file1.txt, and if that also exists, rename to file2.txt, and so on, is that it?
You can't do that with XCOPY itself, as far as I know. But it can be achieved with a batch script. I can develop it, but I need to know how would you like the renaming process to behavior. Does the process I described (file.txt becomes file1.txt, or file2.txt, etc) sounds good?
-- Leonardo Pignataro - Secret_Doom --
secret_doom@hotmail.com
www.batch.hpg.com.br

It sounds good but it would be better if you can append the upper directory's name to it like
dir1
dir2
dir3
file.txtnaming convention:file_dir2.txt
and i want to do the copying from dir1 the root directory which is why i am using xcopy
but i am a newbie at dos programming and not very good with manipulating files like using a loop.It will be better if you can explain your script so i can learn from you.Thanks

![]() |
![]() |
![]() |

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |