help copy files and renaming if needed
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:
if "%1" == "" goto err1
if "%2" == "" goto err2
for /R %1 %%f in
(*.jpg)do copy "%%f" "%2"
echo Please enter the source directory
echo Please enter the destination directory
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