I need to open a webpage using Internet Explorer even if it is not the predefined Browser.
(e.g. Chrome is predefined but I want to open www.ThisRunsOnlyOnInternetExplorer.com.
How to achieve this? Of course with ShellExecute I know how to open the default browser.
Of course this must work on all Windows operating systems and all internet explorer versions so I cannot harcode a path to iexplorer.exe.
Can you suggest a solution?
Note: if there is a way to get the path to iexplorer.exe with some API may be the trick is gtet that path and then use ShellExecute to run
PATH_TO_INTERNET_EXPLORER_EXE www.ThisRunsOnlyOnInternetExplorer.com
You don’t need to use a fully qualified path. When IE is installed it registers itself in the App Paths registry. Consequently you just need to send
iexplore.exetoShellExecute().Note:
CreateProcess()does not use the App Paths mechanism so you must useShellExecute()rather thanCreateProcess().