Link to home
Start Free TrialLog in
Avatar of danetteh
danetteh

asked on

Open an application within VB

I need to add two buttons to a VB app. These buttons need to open Internet Explorer and Adobe Acrobat. I would like to know is there any way to open their .exe's without giving the total, specific path? I've gotten it to work with the shell command but I need to hard code the entire path to the exe. This is not acceptable in the application since clients could have these particular executables in several locations, depending on the version. Can anyone help?
Avatar of tkuppinen
tkuppinen

Have you tried the shellExecute API?  This function will open specific files with their default program.  So if you pass a .pdf file to this function it will open acrobat and the file associated file, so all you would need is the path to the file.  If you pass a url to this same function it will open the site using the default browser.
ASKER CERTIFIED SOLUTION
Avatar of caraf_g
caraf_g

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
Ah, I think I know... Adobe Acrobat opens .pdf files, right?

So find
HKEY_CLASSES_ROOT\.pdf
instead of
HKEY_CLASSES_ROOT\.html

And continue in a similar fashion to .html

etcetera...