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

1 Answer 1

up vote 8 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

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.