Find the Executable

P

Paul Ilacqua

I'm looking to located the adobe Executable's location in a vb 2005 program.
IE on my PC it's located @ "C:\Program Files\Adobe\Reader
9.0\Reader\AcroRd32.exe" but on someone else's it may not even be installed
or in another location.
I appreciate the help.

Thanks
Paul
 
F

Family Tree Mike

Paul said:
I'm looking to located the adobe Executable's location in a vb 2005
program.
IE on my PC it's located @ "C:\Program Files\Adobe\Reader
9.0\Reader\AcroRd32.exe" but on someone else's it may not even be
installed or in another location.
I appreciate the help.

Thanks
Paul

Are you sure you need to find the .exe? I you want to open a pdf file
with it, you can just use the following:

Process p = new Process();
p.StartInfo.FileName = "Some.pdf";
p.StartInfo.Verb = "Open";
p.Start();
 
F

Family Tree Mike

Family said:
Are you sure you need to find the .exe? I you want to open a pdf file
with it, you can just use the following:

Process p = new Process();
p.StartInfo.FileName = "Some.pdf";
p.StartInfo.Verb = "Open";
p.Start();

If you need the path for AcroRd32.exe, it appears there is a registry
key, HKLM\Software\classes\acrobat\shell\open\command, which has a
default value of:

"C:\Program Files (x86)\Adobe\Reader 9.0\Reader\AcroRd32.exe" /u "%1"

for me.

In general though, the actual path is very application specific. You
cannot depend on one way to find all application paths. Even different
versions may change the way it can be found.
 
P

Paul Ilacqua

Thanks Mike,
My only problem is the occasion where a pdf file is not associated with
Adobe, won't the process call just open the file with it's associated
program? In my testing it does.
Thanks again for the input.

Paul
 
F

Family Tree Mike

Paul said:
Thanks Mike,
My only problem is the occasion where a pdf file is not associated
with Adobe, won't the process call just open the file with it's
associated program? In my testing it does.
Thanks again for the input.

Paul

Yes, that is correct. Do you have a reason to force Reader to be used
regardless of the user's file associations?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top