I am trying to use GetFiles to get a list (array) of files on particular drives, however in some cases I do not get what I expect at all. For example:
Dim ScanFiles AsIEnumerable(OfString) = Enumerable.Empty(OfString)()
ScanFiles = Directory.GetFiles("C:\","*.*",SearchOption.AllDirectories)
I would expect this to return all files on drive C, however I only get 49 files and it seems to cutoff at a folder called \Config.msi. No matter how I have tried to tweak this, it will not return the expected files. (Note - there is NO password protection on this drive or any folder on the drive.
As well, I use this command (much as it appears above but with a different drive letter) and it NEVER lists the files in the root. This is especially frustrating since mapped drives are used quite a bit in the project I am trying to complete, and most of those drives have files in the root. It never picks them up.
So why is there an option that says "AllDirectories" if in fact you don't get all directories. Is there any alternative to this that I can use?
Thanks