Does anyone knows fastest way to search a filename in specific folder?

See https://forum.xojo.com/39404-read-contents-of-directory/p3#p467436 and change your If to

If (data.int32value(0) And 16) = 16 Then

Also, I would suggest against new’ing a FolderItem just to split it, use PathFindFileNameW and PathFindExtensionW instead.

Here’s a quick fix, it’ll need a little tidy up

https://www.dropbox.com/s/n5zm8cg8tbgvpw0/TestFindForAditya.xojo_binary_project?dl=0

Hope it helps.

On a side note, it might be better/quicker to add the directories into a list then process them off the list. See the following for more info:

https://web.archive.org/web/20151016004624/http://blogs.msdn.com/b/oldnewthing/archive/2005/02/03/366277.aspx