Link to home
Start Free TrialLog in
Avatar of pin_plunder
pin_plunder

asked on

searching file

How can I know if the person who uses my program has, let's say iexplore.exe on his computer? As I don't know where he could have insatalled it I must search the whole unit 'c:\' for this file, so my question here is how can i do that?

thanks.
Avatar of edey
edey

you could try running a batch file with the line:

dir c:\iexplore.exe /s/b/p > c:\windows\temp\filesrch.txt

then look in:

c:\windows\temp\filesrch.txt

for a line containing iexplore.exe


GL
Mike
listening
Avatar of pin_plunder

ASKER

i'll try, but don't really like the idea, any other suggestions??
You could find path of iexplore.exe in registry.

Root: HKEY_LOCAL_MACHINE
Key: Software\Microsoft\IE Setup\SETUP
Name: Path
Try using findfirst..findnext to scan the drives.
By using findfirst/next for files with attribute of a directory and using ChDir you can recursivly scan through the drive's directories and in each directory use another findfirst..findnext (by calling another function for example) to look for files with the name of the file you are searching for.
Note that such a search can take time. Depending on the file you are looking for it might be better to search only in the PATH or search for a reference to it in the registry.

Hoped it helped...
do u want to search for a specific program (like iexplorer.exe) or the default program for a task (like default browser)?
the first thing, but i'm working on it. I'll try to use the windows registry.
ASKER CERTIFIED SOLUTION
Avatar of johnstoned
johnstoned

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
thanks.