Registry - How to register Internet Explorer as a URI scheme and call from chrome?

2

In order to launch Internet Explorer from chrome in format ie:https://example.com, I have added the following registry:

Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\Classes\ie]
"URL Protocol"="\"\""
@="\"URL:IE Protocol\""

[HKEY_CURRENT_USER\Software\Classes\ie\shell]

[HKEY_CURRENT_USER\Software\Classes\ie\shell\open]

[HKEY_CURRENT_USER\Software\Classes\ie\shell\open\command]
@="cmd /K set url=\"%1\" & call set url=%%url:ie:=%% & call start iexplore %%url%%"

However, it works okay first time launching IE, but failed on the second time due to the double quotes in url(might be a bug for IE). enter image description here

I tried the following two ways to remove double quotes, but neither worked:

  1. Remove ": call set url=%%url:\"=%%. This will cause the command to stop at \" and IE will not appear.

  2. Strip the first and last character: call set url=%%url:~1,-1%%. Just doesn't change url at all.

So how can I remove the double quotes in a cmd script in registry? Or is there another workaround to launch IE in chrome(with minimum effort) ?

CDT

Posted 2019-05-16T08:21:55.707

Reputation: 197

Hmm, your original strategy works for me. Could you please be more specific about what you're doing in Chrome that causes Internet Explorer to open with the misquoted URL? – Ben N – 2019-05-16T17:21:20.943

@BenN I'm just calling window.open('ie:https://www.google.com') in javascript. – CDT – 2019-05-17T00:08:50.293

Could you try this JSFiddle? It works for me consistently.

– Ben N – 2019-05-17T00:22:52.450

@BenN Thanks, same result. Opening the first IE is okay, but if I don't close the first IE window and click Launch IE again, the second IE window's url will behttp://%22https//www.google.com%22. – CDT – 2019-05-17T00:32:53.653

Ah, my mistake - I hadn't realized the problem only occurred when one Internet Explorer window was still open. I've now posted an answer that fixes this for me. – Ben N – 2019-05-17T00:49:11.717

Answers

2

It looks like something is going wrong when Internet Explorer detects multiple instances and presumably tries to do something special in that case. There are command-line options to control "merging" behavior, specifically -nosessionmerging and -noframemerging. When I supply those, I can successfully launch additional Internet Explorer windows.

Also, if you'd like the command prompt to go away after the launch, you can use the /c switch instead of /k. Applying these changes and cleaning up extra quotes from other values gives us this updated Registry file:

Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\Classes\ie]
"URL Protocol"=""
@="URL:IE Protocol"

[HKEY_CURRENT_USER\Software\Classes\ie\shell]

[HKEY_CURRENT_USER\Software\Classes\ie\shell\open]

[HKEY_CURRENT_USER\Software\Classes\ie\shell\open\command]
@="cmd /c set url=\"%1\" & call set url=%%url:ie:=%% & call start iexplore -nosessionmerging -noframemerging %%url%%"

Ben N

Posted 2019-05-16T08:21:55.707

Reputation: 32 973

Great solution, saved my day! I never know iexplore have these arguments. – CDT – 2019-05-17T00:55:28.237

Seems this works on Windows 10 but not on Windows 7. – CDT – 2019-05-30T00:47:25.267

@CDT Hmm, does the exact same behavior (mangled quotes on subsequent launches) reappear? Do the Internet Explorer versions match between the Windows 10 and Windows 7 machines? – Ben N – 2019-05-30T17:22:33.973

0

I used the following so that I can open file:// links in Chrome

Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\Classes\ie]
"URL Protocol"=""
@="URL:IE Protocol"

[HKEY_CURRENT_USER\Software\Classes\ie\shell]

[HKEY_CURRENT_USER\Software\Classes\ie\shell\open]

[HKEY_CURRENT_USER\Software\Classes\ie\shell\open\command]
@="cmd /c set url=\"%1\" & call set url=%%url:ie:=%% & call start iexplore.exe -nosessionmerging -noframemerging -extoff %%url%%"

For example:

<a href="ie:file://server/log/Log.mdb">Test</a>

Simpuhl

Posted 2019-05-16T08:21:55.707

Reputation: 11