How to? exclude a subdirectory when copying

  • This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

samintz

Scott Mintz
May 20, 2008
1,232
11
Solon, OH, USA
#1
How do I structure a file exclusion to exclude a subdirectory when copying a group of subdirectories.
For example:
Code:
Top
├── S1
├── S2
├── S3
└── S4
This will copy the whole tree:
Code:
copy /s Top\ NewTop\
But if I want to exclude S2, how would I do it?
This doesn't work:
Code:
copy /s /[!Top\S2\*] Top\ NewTop\
-Scott