hey how can i search for a file in HDD ,
example i wanna search for a file settings.ini in my computer .
hey how can i search for a file in HDD ,
example i wanna search for a file settings.ini in my computer .
First you have to get a list of valid drives. This was discussed previously on the StackOverflow.
The you have to call FindFirst/FindNext/FindClose on the root folder of each drive. Get a list of files and directories. Check the list of files. Repeat this for each directory. Until you run out of directories. Search for "[delphi] findfirst" on StackOverflow to find more information.
Just adding to the FindFirst/FindNext advice:
Take care with the "." and ".." directory names that come back. Otherwise, you may never run out of items to walk.
Also keep watch for anything coming back, in the WIN32_FIND_DATA result, with the FILE_ATTRIBUTE_REPARSE_POINT flag set. That'll probably be a symlink, and where it goes might also give you an infinite walk. An example can be seen over at the Old New Thing.