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

up vote 5 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 '14 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
1  
Wouldn't you only need /S OR /E, not both? – Kruug Mar 25 '13 at 19:13

You must log in to answer this question.