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.
thanks.
listening
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
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...
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)?
ASKER
the first thing, but i'm working on it. I'll try to use the windows registry.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
thanks.
dir c:\iexplore.exe /s/b/p > c:\windows\temp\filesrch.t
then look in:
c:\windows\temp\filesrch.t
for a line containing iexplore.exe
GL
Mike