Wooltown 2 Posted September 10, 2007 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
weaponx 16 Posted September 10, 2007 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
Wooltown 2 Posted September 10, 2007 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