Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium


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

Posted on 2005-05-05
Medium Priority
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
  • 2
LVL 16

Accepted Solution

craylord earned 800 total points
ID: 13942060
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 39

Assisted Solution

BillDL earned 800 total points
ID: 13943499

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 google.com.


Author Comment

ID: 13946434
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 39

Expert Comment

ID: 13952664
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

 [eBook] Windows Nano Server

Download this FREE eBook and learn all you need to get started with Windows Nano Server, including deployment options, remote management
and troubleshooting tips and tricks

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The following is a collection of cases for strange behaviour when using advanced techniques in DOS batch files. You should have some basic experience in batch "programming", as I'm assuming some knowledge and not further explain the basics. For some…
One of my most closely kept secrets is revealed in this discussion How to output text on the same line This question was recently posted in EE by Simon336697 (http://www.experts-exchange.com/Programming/Languages/Scripting/Shell/Batch/Q_2459…
As many of you are aware about Scanpst.exe utility which is owned by Microsoft itself to repair inaccessible or damaged PST files, but the question is do you really think Scanpst.exe is capable to repair all sorts of PST related corruption issues?
Enter Foreign and Special Characters Enter characters you can't find on a keyboard using its ASCII code ... and learn how to make a handy reference for yourself using Excel ~ Use these codes in any Windows application! ... whether it is a Micr…
Suggested Courses

577 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