i from the cmd promp i want to search all my JPG files on my hard drive and copy it to a single directory.

i use this code in a bat file:

@echo off
if "%1" == "" goto err1
if "%2" == "" goto err2
for /R %1 %%f in

(*.jpg)do copy "%%f" "%2"
goto ending
:err1
echo Please enter the source directory
goto ending
:err2
echo Please enter the destination directory
:ending


the only problem is when there is a filename with the same name on the destination directory it's replace with the new one.

is there any way to renaming if it finds a file with the same name?

can someone give me a hand with this?

thanks in advance