473,396 Members | 1,871 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Getting path to default PDF viewer?

In my application, if a user tries to open up a PDF file, I want the
users "default" PDF viewer to open up and display it. By default, i
mean, either the free Acrobat Reader, or the full Adobe Acrobat
licensed software, if installed.

Any idea how I can find out the path name to the .exe? (as it may vary
from user to user)

Thanks!
John

Nov 21 '05 #1
4 6691


johnb41 wrote:
In my application, if a user tries to open up a PDF file, I want the
users "default" PDF viewer to open up and display it. By default, i
mean, either the free Acrobat Reader, or the full Adobe Acrobat
licensed software, if installed.

Any idea how I can find out the path name to the .exe? (as it may vary
from user to user)


It's all in the registry. I *think* this is the correct sequence to
follow:

HKCR\.pdf:(Default)
This should be "AcroExch.Document"
HKCR\AcroExch.Document\shell\open\command:(Default )
On my machine this is
"C:\Program Files\Adobe\Acrobat 6.0\Reader\AcroRd32.exe" "%1"

Substitute your filename in for %1 and there you have the command line
to run.

--
Larry Lard
Replies to group please

Nov 21 '05 #2
"johnb41" <or****@informatik.com> wrote in message
news:11**********************@g47g2000cwa.googlegr oups.com...
In my application, if a user tries to open up a PDF file, I want the
users "default" PDF viewer to open up and display it.


A better way to do this than finding the PDF viewer EXE is to simply tell
Windows to open the file with its default viewer. You can do this as
follows:

\\\
Dim proc As New Process
'Set the process details
With proc.StartInfo
'Set the information for the file to launch
.FileName = "C:\YourPDFFile.pdf"
.UseShellExecute = True
End With
'Open the file
proc.Start()
///

--

(O)enone
Nov 21 '05 #3


Oenone wrote:
"johnb41" <or****@informatik.com> wrote in message
news:11**********************@g47g2000cwa.googlegr oups.com...
In my application, if a user tries to open up a PDF file, I want the
users "default" PDF viewer to open up and display it.


A better way to do this than finding the PDF viewer EXE is to simply tell
Windows to open the file with its default viewer. You can do this as
follows:


Aaargh and I knew that as well. In my defence, it's very warm here...
our aircon has failed :(

--
Larry Lard
Replies to group please

Nov 21 '05 #4
Thanks Oenone, that's exactly what I needed!

John

Nov 21 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Mohan | last post by:
Hi All, I am using web browser control in a VB 6.0 client server application to print reports. I am writing the report into a HTML file and displays the report to the user using the code,...
1
by: Alex | last post by:
Hello, in my company, we have a diagnostic tool for hardware. Depending on the hardware projcet, a different project configuration is needed. The configuration file is written in XML and...
0
by: Nicola George | last post by:
Hi all, I hope someone can help me as I'm going a bit metal with this problem. I have a project in ASP.NET, within this project I have Crystal Report called Catalogue. On an asp page I have a...
0
by: Steven | last post by:
Hello In my asp.net app I'm using a xml viewer to display an xml document. I have several xml documents under C:\MyWebS\XMLDocs folder. Depending on the user selection I will be passing the...
3
by: PJ6 | last post by:
Is it possible to get the absolute path (i.e. C:\inetpub\wwwroot) of the IIS root directory? And yes, I do need to get the actual, absolute path, because the Crystal Reports XI web viewer does -...
1
by: iwdu15 | last post by:
hi, how can i get the icon associated with a certain file type? thanks -- -iwdu15
3
by: Vins | last post by:
Hey there, I used the FOR XML PATH feature but the XML result is in only one line, it does not conserve the XML structure (treeview). When I open the XML file with IE, it s working very (I have...
7
by: epikto | last post by:
I have a mapped share that I am trying to get a listing of all the files that it contains. I use the following code to access the contents String files = Directory.GetFiles(path); I can then...
2
by: =?Utf-8?B?R3lhbmVuZHJh?= | last post by:
I am using Ajax control(Update Panel) in my web page(ASP.Net 2.0) and putting Report Viewer(Sql Server Reporting Services 2005) Control in it. When I am displaying any report it is coming...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.