954,480 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

API to find executables or files

hi there. Am working on a program that finds the binary executable of a particular program
when we input its filename. For example:

INPUT: cmd.exe
OUTPUT: c:\windows\system32\cmd.exe

Am using the following API's:

FindExecutable()
SearchPath()

if you got any other API or any other ways to find executable progrmatically, please share
it with me.

thank u

Mahen
Junior Poster
144 posts since Aug 2004
Reputation Points: 10
Solved Threads: 2
 

C'mon Help me guys

Mahen
Junior Poster
144 posts since Aug 2004
Reputation Points: 10
Solved Threads: 2
 
INPUT: cmd.exe OUTPUT: c:\windows\system32\cmd.exe

Based on that example, SearchPath() is all what you'll need. But if for some reason you plan to search in any folder, you could use FindFirstFile()/FindNextFile() and a recursive search routine.

FindExecutable() is used to find file associations. You know, passing a TXT file will return Notepad, etc.

Hope this helps.

Alvein
Junior Poster
104 posts since Jul 2005
Reputation Points: 12
Solved Threads: 4
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You