# How do I exclude a directory based on a wildcard filter

**URL:** https://www.finalbuilder.com/forums/t/how-do-i-exclude-a-directory-based-on-a-wildcard-filter/838
**Category:** Discussion
**Created:** [May 7, 2008, 11:07am UTC](https://www.finalbuilder.com/forums/t/how-do-i-exclude-a-directory-based-on-a-wildcard-filter/838 "2008-05-07T11:07:34Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![jonathanl](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/j/85e7bf/32.png) [@jonathanl](https://www.finalbuilder.com/forums/u/jonathanl)
#### Post date: [May 7, 2008, 11:07am UTC](https://www.finalbuilder.com/forums/t/how-do-i-exclude-a-directory-based-on-a-wildcard-filter/838/1 "2008-05-07T11:07:34Z")

</div>

I'm using Finalbuilder to make a build image which is then compiled into a setup program.

I have a list of directories which are in the build tree, called noredistribute-X11, noredistribute-X22.

I can make the image using either a Directory copy and then delete these directories or exclude these from being copied using a FileSet.

However using either method, I can't find a way of deleting directories based on my wildcard exclude noredistribute\*

Is there any body that could provide a suggestion on how to get this working.

---

<div class="post-metadata">

### Author: ![jonathanl](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/j/85e7bf/32.png) [@jonathanl](https://www.finalbuilder.com/forums/u/jonathanl)
#### Post date: [May 7, 2008, 4:51am UTC](https://www.finalbuilder.com/forums/t/how-do-i-exclude-a-directory-based-on-a-wildcard-filter/838/2 "2008-05-07T04:51:10Z")

</div>

or simply   
  
 Is there anyway of deleting a list of directories with a wildcard   
  
 i.e. all directories called \noredistribute\*\

---

<div class="post-metadata">

### Author: ![jonathanl](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/j/85e7bf/32.png) [@jonathanl](https://www.finalbuilder.com/forums/u/jonathanl)
#### Post date: [May 8, 2008, 11:21am UTC](https://www.finalbuilder.com/forums/t/how-do-i-exclude-a-directory-based-on-a-wildcard-filter/838/3 "2008-05-08T11:21:54Z")

</div>

I have found a solution.

A program call xrd allows directory deletion using a wildcard. I run this as a DOS command.

The program is available from [http://www.geocities.com/jadoxa/delenxrd/](http://www.geocities.com/jadoxa/delenxrd/)

---

<div class="post-metadata">

### Author: ![angus](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/a/b3f665/32.png) [@angus](https://www.finalbuilder.com/forums/u/angus)
#### Post date: [May 9, 2008, 2:10am UTC](https://www.finalbuilder.com/forums/t/how-do-i-exclude-a-directory-based-on-a-wildcard-filter/838/4 "2008-05-09T02:10:30Z")

</div>

Hi Jon,   
  
 Glad you found a solution. There’s no particularly easy way to do this with FinalBuilder at the moment - we can look at expanding the Folder Iterator action so it supports wildcards, at which point you could use a Folder Iterator with a Delete Directory action as its child. To make a “pure” FinalBuilder solution at the moment you will need to use Folder Iterator -\> If … Then -\> Delete Directory, which is a bit fiddly.   
  
 Regards,   
  
 Angus
