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 need to copy a file/directory structure recursively but without copying file contents (creating 0-length files). Is there any way to do that without custom scripting?

Windows 7

share|improve this question
up vote 10 down vote accepted

This should do exactly what you're asking: (edit: no it does not!)

xcopy <source dir> <destination dir> /T /E /O

Edit: This should be closer to what you're looking for:

robocopy <source dir> <destination dir> /E /CREATE

Robocopy should come with Windows 7. Let me know if I got it right this time. :)

share|improve this answer
    
Thank you. I'll look at that more but currently none file is created, only directory structure is copied. – Pavel Vlasov Sep 7 '11 at 12:01
    
@Pavel Vlasov You're right, that command will not create 0-length files like you asked, I missed that requisite. Sorry. – MacThePenguin Sep 7 '11 at 12:09
    
@Pavel Vlasov I have edited my answer adding a different solution. – MacThePenguin Sep 7 '11 at 12:18
    
Thank you! New snippet works fine. – Pavel Vlasov Sep 7 '11 at 12:32

You must log in to answer this question.

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