I was not suggesting you insert GetFileAttr()...
You already have it in three places.
I cannot make sense of that spaghetti code. (sorry )
Just trying to get you to understand that GetFileAttr() is what you need to filter on folders. Of course there is the method Radimus (not Lonkero) suggested as well.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.