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 want to copy selected files in a sub directory from the source folder to a destination folder, at the same time, preserve the directory structure.


  • source_dir
    • sub1
      • file_1
      • file_2
    • sub2
      • file 3


  • dest_dir
    • sub1
      • file1

How do I issue one command to do that? I tried robocopy

robocopy c:\source_dir c:\dest_dir sub1\file_1 /s

robocopy complained that the file parameter (Parameter #3) is invalid.

share|improve this question

1 Answer 1

Try this:

robocopy C:\source_dir C:\dest_dir /s /if file1 file2 file3
share|improve this answer
that should work except it scans all directory when I want file1 from a specific directory –  Candy Chiu Jun 20 '13 at 18:55

Your Answer


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.