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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Finding an EXE file and retrieving Path

Status
Not open for further replies.

Modex

Programmer
Sep 15, 2002
155
GB
Hi all

What I would like to do is search a system for a specific EXE file. The Chances are it would always be in the same place such as “C:\program Files\Winvnc.exe” however there could be times when on certain machines the program may exist elsewhere on the disk in a different directory.

So my question is, is it possible to search the file system using the FileSystemObject for the exe file and come back with a path of where the EXE is located.

If not I will have to make sure the EXE is always installed in the same place

Many thanks

ModeX :)

 
Have you considered storing the location of the exe in something that you can configure, for example an ini file for a registry entry?

mmilan
 
You can also use the FindFirstFile and FindNextFile APIs. There is a good example of their use in VB here:


________________________________________________________________
If you want to get the best response to a question, please check out FAQ222-2244 first

'If we're supposed to work in Hex, why have we only got A fingers?'
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top