3

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

11

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

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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