Registry - How to register Internet Explorer as a URI scheme and call from chrome?
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).
I tried the following two ways to remove double quotes, but neither worked:
Remove
"
:call set url=%%url:\"=%%
. This will cause the command to stop at\"
and IE will not appear.Strip the first and last character:
call set url=%%url:~1,-1%%
. Just doesn't changeurl
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) ?
Solution 1:
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%%"