Hi,
I am creating a small application which works like a utility. I need to pass a file name as a commandline argument and after pressing Enter key, it should search the file name in the entire disk and it should give the path of that particular file. Like in Windows, when we see search for files and folders, we provide file name and it gives all possible combinations. Here in my case file is unique and would placed at single location on disk. So that would made the search easier. But how to search that file name on entire disk
A quick help is appreciated.
Regards,

Search for a file name on disk.
C4702
Hi, refer to link below
http://support.microsoft.com/kb/303974
Welington Lima
Sorry, I forgot to mention. As a path, you select something like C:\
Greetz,
Geert
Geert Verhoeven
Consultant @ Ausy Belgium
My Personal Blog
Dotnetter03
nunes_David
Kay-Davis
The above solution is the best you can get since when a file is found, you can stop the iteration.
An alternative solution is by using the overloaded GetFiles method of the System.IO.Directory and set the SearchOption to AllDirectories. The disadvantage of this solution is that you can't break when one is found.
References:
Greetz,
Geert
Geert Verhoeven
Consultant @ Ausy Belgium
My Personal Blog