Q: System.IO.Directory.GetFiles returns different result than Windows XP Search Companion I am using this statement to find all files recursively:
fileNames = System.IO.Directory.GetFiles(path, "*.*",
    System.IO.SearchOption.AllDirectories);

The total number of files that are found is sgnificantly lower than wehen using Windows XP Search Companion. This is not caused by hidden files, I checked that. It looks like some directories with a deep nesting level are skipped by GetFiles, but not by Windows Search Companion. GetFiles counts the same number of files as "dir /s" in a command prompt. Anyone have a clue?
Thanks,
Neeva

A: Search Companion looks inside ZIP files.  Do you have any of those in the directory tree?

A: Can you confirm that there is no exception thrown?
Particularly, PathTooLongException?
try {
    fileNames = System.IO.Directory.GetFiles(path, "*.*",
        System.IO.SearchOption.AllDirectories);

} catch (System.IOPathTooLongException) {
    System.Diagnostics.Debug.Fail("Some path is too long to be processed.");

}


A: System files?

What's the result of:
dir/s/as  
dir/s/ah

The search companion could have filters on, have you checked that?
And can you publish the search result?
