• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 434
  • Last Modified:

Copy all subfolders except one

I need to copy all the files & folders in 1 directory while excluding 1 specific sub directory.  

For example I want to copy C:\Data while excluding C:\Data\temp.  Is there an application or cmd I can use?
1 Solution
Brian PringleSystems Analyst II, SCM, ERPCommented:
You can use XCOPY with the /EXCLUDE: option.
Another option robocopy:

/XF file [file]... : eXclude Files matching given names/paths/wildcards.
/XD dirs [dirs]... : eXclude Directories matching given names/paths.
                     XF and XD can be used in combination  e.g.
                     ROBOCOPY c:\source d:\dest /XF *.doc *.xls /XD c:\unwanted /S
tampatechmanAuthor Commented:
this worked perfectly
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Simplify Active Directory Administration

Administration of Active Directory does not have to be hard.  Too often what should be a simple task is made more difficult than it needs to be.The solution?  Hyena from SystemTools Software.  With ease-of-use as well as powerful importing and bulk updating capabilities.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now