Link to home
Start Free TrialLog in
Avatar of jfreisen
jfreisen

asked on

Running another executable but don't know path

I need to run another exe from my delphi5 app. I have used the winexec and shellexecute, but what if I do not know the path of the executable. I am trying to run WordPerfect and pass it a macro name, but I do not want to hard code the path of WP install
Avatar of Rheingold
Rheingold

Can't you just ask the user where WordPerfect is installed and save this path somewhere? Or you could look in the registry, in the part where the stuff is saved which program belongs to which filetype. Get the standard WordPerfect filetype extension and look which prog is default to open these kind of files. Then you have the path.

Regards
if the macro file name ext. is registered to wp, then "executing" the macro directly will cause windows to use wp to run the macro, just like attempting to run a .wpd file.

Gl
Mike
If you don't know where the another executable is, you might have to use an
exhaustive search in your drive to locate it.  
ASKER CERTIFIED SOLUTION
Avatar of skyrider_tieus
skyrider_tieus

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
you should access the registry.

HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\App Paths

here you search for the key with your app's exename.

if you want I will write you some code.