# Iterator (and recursive delete files) gets path wrong

**URL:** https://www.finalbuilder.com/forums/t/iterator-and-recursive-delete-files-gets-path-wrong/3440
**Category:** Bugs
**Created:** [May 25, 2012, 2:55am UTC](https://www.finalbuilder.com/forums/t/iterator-and-recursive-delete-files-gets-path-wrong/3440 "2012-05-25T02:55:22Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![tony.hoyle](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/t/97f17d/32.png) [@tony.hoyle](https://www.finalbuilder.com/forums/u/tony.hoyle)
#### Post date: [May 25, 2012, 2:55am UTC](https://www.finalbuilder.com/forums/t/iterator-and-recursive-delete-files-gets-path-wrong/3440/1 "2012-05-25T02:55:22Z")

</div>

Using FinalBuilder 7.0.0.1795   
  
 I have an iterator set to iterate $(Base)/XMLTests/NewXML/\*.xml, and set that to variable CurrentFile   
  
 I have ‘include path when setting variable’ checked.   
  
 This variable ends up with a random location instead of the correct path, making this function unusable.   
  
 Putting a log inside this iterator block shows the problem - it shows   
  
 CurrentFile = D:\Rps\3x3LightOakOnWhiteEdWithRoofVents.xml   
  
 Which is completely wrong (it’s not even $(Base) or the project directory… it’s apparently random). This causes all subsequent actions to fail.   
  
 The ‘Delete File(s)’ action behaves in the same way, blowing up with a file does not exist error every time.   
  
 As the file list is currently fixed I’ve worked around it by adding a hard coded entry for each file, but that’s not a good solution for the future.   
  
 Tony

---

<div class="post-metadata">

### Author: ![Vincent](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/vincent/32/938_2.png) [@Vincent](https://www.finalbuilder.com/forums/u/Vincent)
#### Post date: [May 26, 2012, 1:35am UTC](https://www.finalbuilder.com/forums/t/iterator-and-recursive-delete-files-gets-path-wrong/3440/2 "2012-05-26T01:35:14Z")

</div>

Hi Tony   
  
 Add a variable watch and step through the project to see what the value of Base is. If you send your project to [support@finalbuilder.com](mailto:support@finalbuilder.com) then I can take a look and see what is happening.
