Jump to content

Recommended Posts

Posted

How do I open the default program for a html file or any other file with a specific extension ?

A file with extension .htm or .tml how do I find out which is the default program to use ?

Posted

You can open a file in its default application using ShellExecute()

To determine the program opening a certain file extension you will have to look in the registry:

HKEY_CLASSES_ROOT

HKEY_CLASSES_ROOT\Applications

HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts

Posted

Thanks for pointing out the right direction

Here is an example of how to do it.

$l_MRUList = StringLeft(RegRead("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.htm\OpenWithList","MRUList"),1)

$l_OpenWithList = RegRead("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.htm\OpenWithList",$l_MRUList)

$l_Command = RegRead("HKEY_CLASSES_ROOT\Applications\" & $l_OpenWithList & "\shell\open\command","")
msgbox(0,"",$l_Command)

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...