Is there any way I can XCOPY without overwriting files??

Posted on 2005-05-05
Last Modified: 2008-01-09

I have been looking for some kind of program that I can use to do the
copy without overwriting tracks.   The dos command;

xcopy "d:\My Music" /s/v/e

It works great for doing large moves, but the /Y flag makes it answer
yes to overwriting all the files.   I want to find something that has
the ability to answer No to overwriting all the files.

There is lots of backup software out there, but it compresses them in
to backup archives.   I don't want that, I want to be able to access
the music directly off the drive.

Seems like there would be plenty of other people out there that could
use the same thing, especially in the digital music age.   You would
think it wouldn't be hard to find.   I have been all over the internet
and can't find anything that is do it.

Thanks for your help and ideas!
Question by:RichEmpens
    LVL 16

    Accepted Solution

    add a /d variable. Then it will only copy files that are newer and skip files that have the same time/date stamp.

    xcopy "d:\My Music\*" "H:\backup_music\" /d /s /v /e /y
    LVL 38

    Assisted Solution


    you are using 2 contradictory command line options ie. the /S and /E

    /S  Copies directories and subdirectories EXCEPT empty ones
    /E  Copies directories and subdirectories INCLUDING empty ones.

    I assume that the "V" option you have in your command should be "U":

    /U  Updates the files that already exist in destination

    Instead of using the /Y option that will not prompt before overwriting, use /-Y which will prompt you if a file of the same name is about to be overwritten.

    It's always best to do a dry run and output the results to a file before running a command inreal time.

    /L  Displays files that WOULD be copied

    > filename.txt  after the command will redirect the screen output to the named .txt file.

    I suggest that you download the following free program by Karen Kenworthy that has multiple uses, and allows for filtered incremental backups and batch file copying:


    Run it, after installing, and click the "Settings" button to configure it.

    Another useful tool is "Beyond Compare" by Scooter Software:

    It has a 30-day demo and, if you like it, then it is pretty cheap to buy at $30 for the wealth of functions it can perform.  I use it primarily for file or folder comparisons.

    There are a lot of command-line tools available for free (or shareware with occasional nags) that work well for batch file copying and folder synchronisation, and these can be easily found by typing good keywords into

    Author Comment

    Reply to craylord -
    Thanks, that /D switch did the trick!   I guess I overlooked it in the documentation I read.  Thanks again, it is a huge relief!
     Reply to BillDL -
     I think I am going to go with the Xcopy solution for now, since I already have it and it solves my problem straight away.   I am definetly going to look into those other applications you gave me links for though.  Ultimately I will likely go with one of your suggestions as a better and permanent solution.  I sure appreciate all the effort you put forth to give me so many good options.

    To me, it only makes sense for me to up-the-ante and split the points between you - for the immediate solution, and for the future solution.

    Thanks much!


    LVL 38

    Expert Comment

    Thank you, Rich, and good luck.

    As a point of note, I see that you refer to "the documentation that I read" in reference to the xcopy command.  To output the usage options for any DOS command to a text file for later reference, just add the /? option after the command and then add the redirect symbol ( > ) mentioned above, eg. for xcopy:

    xcopy /? >  c:\windows\desktop\xcopy_options.txt

    Keep filenames short and use either truncated DOS folder names like c:\mydocu~1 or enclose the path in " " if it contains spaces if in full DOS, eg.

    xcopy /? > c:\mydocu~1\mystuf~1\xcopy1.txt
    xcopy /? > "c:\my documents\my stuff\xcopy1.txt".

    the xcopy command actually uses xcopy32.exe if used within Windows and retains long file names.  You should also know that there are some issues with xcopy that relate to the dos abbreviated file name allocated to windows long file names as discussed here:

    There are many more such examples, but these issues probably won't affect you in what you are using xcopy to do.

    Alternatives for mission-critical activities like backups:

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Join & Write a Comment

    Using dates in 'DOS' batch files has always been tricky as it has no built in ways of extracting date information.  There are many tricks using string manipulation to pull out parts of the %date% variable or output of the date /t command but these r…
    TOMORROW TOMORROW.BAT is inspired by a question I get asked over and over again; that is, "How can I use batch file commands to obtain tomorrow's date?" The crux of this batch file revolves around the XCOPY command - a technique I discovered w…
    how to add IIS SMTP to handle application/Scanner relays into office 365.
    Here's a very brief overview of the methods PRTG Network Monitor ( offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

    734 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    22 Experts available now in Live!

    Get 1:1 Help Now