Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Searching all drives for a file

Status
Not open for further replies.

solidjp

Programmer
Jul 16, 2002
29
US
In my VB application, I have command buttons set up so when a user clicks on one of them an application executes. If the path to that exe is not the default location, I need it to then search all the drives mounted on that particular machine until it finds that exe name. So what is the call to that particular Search function? Is it an API call or is it something else?

Thanks
 
You should get the list of all drives using GetLogicalDriveStrings API function.

After that you need to search each drive one-by-one using file searching API functions. They are FindFirstFile, FindNextFile and FindClose.
 
You can also perform the search using the methods of the FileSystemObject, or the intrinsic Dir function.

Good Luck
--------------
As a circle of light increases so does the circumference of darkness around it. - Albert Einstein
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top