Go Back   Forum Care Forums > Development Reference Area > Visual Basic

Reply
 
LinkBack Thread Tools Display Modes
Finding a path to a program
Old
  (#1)
Ivan Bernage
Guest
 
Posts: n/a
Default Finding a path to a program - 06-04-2007, 10:33 AM

Hello,

My problem:
In a VB6-program I would like to find the path to the program ***ociated
to a given extension. E.g. given the extension *.doc I would like to
find the path to winword.exe (on a single computer, not in a network).
The necessary information can be found in the registry. But how to
extract it easily? Is there some utility available or do I have to
program the whole process?

Thanks in advance for your information,

Ivan
   
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Re: Finding a path to a program
Old
  (#2)
Geoff
Guest
 
Posts: n/a
Default Re: Finding a path to a program - 06-04-2007, 10:33 AM

The easiest way is to create a temporary blank file named with the extension
and call the API
FindExecutable which will give you the application info
Then delete the file
'
"Ivan Bernage" <EMAIL REMOVED> wrote in message
news:458979df$0$31458$EMAIL REMOVED...
> Hello,
>
> My problem:
> In a VB6-program I would like to find the path to the program ***ociated
> to a given extension. E.g. given the extension *.doc I would like to
> find the path to winword.exe (on a single computer, not in a network).
> The necessary information can be found in the registry. But how to
> extract it easily? Is there some utility available or do I have to
> program the whole process?
>
> Thanks in advance for your information,
>
> Ivan



   
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Re: Finding a path to a program
Old
  (#3)
Dean Earley
Guest
 
Posts: n/a
Default Re: Finding a path to a program - 06-04-2007, 10:33 AM

Ivan Bernage wrote:
> In a VB6-program I would like to find the path to the program ***ociated
> to a given extension. E.g. given the extension *.doc I would like to
> find the path to winword.exe (on a single computer, not in a network).
> The necessary information can be found in the registry. But how to
> extract it easily? Is there some utility available or do I have to
> program the whole process?


Do you actually need the executable path or just want to open the
executable?
If the latter, then look at ShellExecute.
This wraps up the file handling stuff for you and is used by Explorer
when you open files.

--
Dean Earley (EMAIL REMOVED)
i-Catcher Development Team

iCode Systems
   
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Re: Finding a path to a program
Old
  (#4)
Dean Earley
Guest
 
Posts: n/a
Default Re: Finding a path to a program - 06-04-2007, 10:33 AM

Dean Earley wrote:
> Ivan Bernage wrote:
>> In a VB6-program I would like to find the path to the program
>> ***ociated to a given extension. E.g. given the extension *.doc I
>> would like to find the path to winword.exe (on a single computer, not
>> in a network).
>> The necessary information can be found in the registry. But how to
>> extract it easily? Is there some utility available or do I have to
>> program the whole process?

>
> Do you actually need the executable path or just want to open the
> executable?


Sorry, open the Document, not Executable.

--
Dean Earley (EMAIL REMOVED)
i-Catcher Development Team

iCode Systems
   
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Re: Finding a path to a program
Old
  (#5)
Ivan Bernage
Guest
 
Posts: n/a
Default Re: Finding a path to a program - 06-04-2007, 10:33 AM

Ivan Bernage schreef:
> Hello,
>
> My problem:
> In a VB6-program I would like to find the path to the program ***ociated
> to a given extension. E.g. given the extension *.doc I would like to
> find the path to winword.exe (on a single computer, not in a network).
> The necessary information can be found in the registry. But how to
> extract it easily? Is there some utility available or do I have to
> program the whole process?
>
> Thanks in advance for your information,
>
> Ivan



Thank you for your expert advice and a merry Christmas to you all!
Ivan
   
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On





Contact Us - Forum Care Forums - Archive - Top