Jump to content

Open the default program for .htm/.html files


Wooltown
 Share

Recommended Posts

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

Link to comment
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)
Link to comment
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
 Share

  • Recently Browsing   0 members

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