Wooltown Posted September 10, 2007 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 ?
weaponx Posted September 10, 2007 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
Wooltown Posted September 10, 2007 Author 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)
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now