I guess without knowing how it's scanning files (in what order), this is going to be a long process

It is scanning in Windows file structure order. A binary chop is by far the most efficient way to find the problem file. With 40K files you could expect to find the problem file in about 15 iterations worst case.

Rob