Sign in to follow this  
Followers 0
Wooltown

Open the default program for .htm/.html files

3 posts in this topic

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 ?

Share this post


Link to post
Share on other sites



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

Share this post


Link to post
Share on other sites

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)

Share this post


Link to post
Share on other sites

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
Sign in to follow this  
Followers 0