Hi @Zhu, Ligong,
Thank you for your information. I have tested your code, but I can't reproduce this issue because it launches Microsoft Edge every time.
This issue occurs in one of every four or five times, which sounds like something's wrong with the application itself. As a matter of fact, I suggest you repair Microsoft Edge in Control Panel --> Programs and Features --> Microsoft Edge --> Change.
If repair does not fix this issue, I suggest you still use "iexplore.exe" for ShellExecute(), which is proved to work on your side.
=================
UPDATE
There're 2 ways if you still need to launch Microsoft Edge (IE mode) via JavaScript code:
- Add
--user-data-dir=<path>
command line formsedge
(not iexplore.exe), but with a different <path> for each session. - If you use IE mode site list policies, you can configure sites like this with the
merge-type="no-merge"
attribute:
<site url="contoso.com">
<open-in merge-type="no-merge">IE11</open-in>
</site>
Then the site should be in its own unmerged IE session without modifying the JavaScript code.
For more information, please read Does IE mode on Microsoft Edge support the 'no-merge' option that was supported in Internet Explorer 11?
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.
Best Regards,
Shijie Li