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 am trying to copy one directory to another directory. It seems I can copy a file but directories won't copy.

Running this at cmd:

XCOPY C:\Drivers C:\Users\lenovo\Desktop 

Gives

0 File(s) copied

can you please help. Thanks.

share|improve this question

migrated from stackoverflow.com Mar 24 '13 at 15:06

This question came from our site for professional and enthusiast programmers.

2 Answers 2

up vote 4 down vote accepted

Please, see help for XCOPY

 /S           Copies directories and subdirectories except empty ones.
 /E           Copies directories and subdirectories, including empty ones.
share|improve this answer
    
Thanks. I did look at the help, seems I missed it :/ –  Aashiq Hussain Mar 24 '13 at 12:07
    
Glad to help, please, mark this as answer if it helped you. –  user398797 Mar 24 '13 at 12:10
    
unless a folder contains something other than a folder, it is considered empty, even if that sub folder contains files –  TruthOf42 Oct 15 at 21:30

Use the following command to copy all the files and folders in C:\Drivers to C:\Users\lenovo\Desktop:

XCOPY /S /E C:\Drivers\*.* C:\Users\lenovo\Desktop 

Like the other person said

/S           Copies directories and subdirectories except empty ones.
/E           Copies directories and subdirectories, including empty ones.

You can also look for other parameters of xcopy from here.

share|improve this answer
    
Wouldn't you only need /S OR /E, not both? –  Kruug Mar 25 '13 at 19:13

Your Answer

 
discard

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