Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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
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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .