Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have the following backup batch file:

xcopy C:\test.txt \\server\Data\user\"data test" /e /y /i

Why does it not only copy the file listed but proceeds to copy the whole root directory?

When I remove the switches it only copies the file. There is nothing in the description of those switches that seems to cause the behavior. They are there because I'm picking up where someone else left and all the batch files use these three switches.

share|improve this question

1 Answer 1

up vote 1 down vote accepted

According to my command line help, the /E switch copies directories and subdirectories:

XCOPY source [destination] [/A | /M] [/D[:date]] [/P] [/S [/E]] [/V] [/W]
                           [/C] [/I] [/Q] [/F] [/L] [/G] [/H] [/R] [/T] [/U]
                           [/K] [/N] [/O] [/X] [/Y] [/-Y] [/Z]
                           [/EXCLUDE:file1[+file2][+file3]...]


  **/E           Copies directories and subdirectories, including empty ones.
               Same as /S /E. May be used to modify /T.**
share|improve this answer
    
ahh, dropping the /e means it wont attempt the whole directory...good to know cheers –  piagetblix Jun 9 '10 at 18:53

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.