Directory Scanning

No worries :smiley:

Hmm, looking over the code and the data structure there could be directories that have other flags set which wouldn’t be highlighted with a simple 16 check so you’d need to change:

If result.int32value(0) = 16 Then

to

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

so it checks for the existence of the 16 flag (FILE_ATTRIBUTE_DIRECTORY) no matter what other flags are set.

Seems like I did the same correction last year Does anyone knows fastest way to search a filename in specific folder? - #10 by anon20074439 :wink:

I hope this sorts it.