1

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

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

Destination

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

1 Answer 1

1

Try this:

robocopy C:\source_dir C:\dest_dir /s /if file1 file2 file3
1
  • that should work except it scans all directory when I want file1 from a specific directory
    – Candy Chiu
    Jun 20, 2013 at 18:55

You must log in to answer this question.

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