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

link|improve this question

75% accept rate
feedback

1 Answer

up vote 2 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. :)

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

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.