Copy Only Missing Files

batch-file

Solution

solution 1 :

xcopy  /d/y

should work..........

solution 2

echo "No" | copy/-Y c:\source c:\Dest\

working. tested

2 folders have the same files , lets try to copy.

 C:\r\Roi>echo "No" | copy/-Y  . 2
.\DSpubring.pkr
Overwrite 2\DSpubring.pkr? (Yes/No/All): "No"
Overwrite 2\DSpubring.pkr? (Yes/No/All):
.\DSsecring.skr
Overwrite 2\DSsecring.skr? (Yes/No/All):
        0 file(s) copied.

lets create 1 new file

C:\r\Roi>copy con g.txt
sdfsdf
^Z
    1 file(s) copied.

lets copy :

C:\r\Roi>echo "No" | copy/-Y  . 2
.\DSpubring.pkr
Overwrite 2\DSpubring.pkr? (Yes/No/All): "No"
Overwrite 2\DSpubring.pkr? (Yes/No/All):
.\DSsecring.skr
Overwrite 2\DSsecring.skr? (Yes/No/All):
.\g.txt
        1 file(s) copied. <------------ one file only

Problem

Let me preface this question by saying that I am relatively new to writing batch files, so I apologize if my question seems remedial. I'm trying to move files from a directory to a shared drive that I have mapped. I know that using "XCOPY c:\etc.. z:\etc.. /Y" will copy everything from one place to another, but what I don't want to do is overwrite every file every time. Is there a way to copy just the files that are not located in the destination directory?

Original source