1.先新建四个文件 chromeOpenIE.reg,install.bat,install.vbs,openIE.bat
chromeOpenIE.reg
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\chromeOpenIE]
@="IE"
"URL Protocol"=""
[HKEY_CLASSES_ROOT\chromeOpenIE\DefaultIcon]
@="iexplore.exe,1"
[HKEY_CLASSES_ROOT\chromeOpenIE\shell]
[HKEY_CLASSES_ROOT\chromeOpenIE\shell\open]
[HKEY_CLASSES_ROOT\chromeOpenIE\shell\open\command]
@="\"C:\\Program Files\\chromeOpenIE\\openIE.bat\"\"%1\""
install.bat
@echo off
REGEDIT /S chromeOpenIE.reg
echo "安装成功"
mshta "javascript:new ActiveXObject('WScript.Shell').Popup('安装成功!',7,'提示',64);window.close();"
Popup()中是放的提示语,根据自己的需要更换,对应的效果
install.vbs
CreateObject("WScript.Shell").Run "cmd /c install.bat",0
openIE.bat
@echo off
set m=%1%
set m=%m:chromeOpenIE:=%
start "" "C:\\Program Files\\Internet Explorer\\iexplore.exe" %m%
exit
2.WinRAR压缩成chromeOpenIE.exe文件
a.选择三个文件压缩
b.改名为chromeOpenIE.exe
c.勾选"创建自解压格式压缩文件"
c.选择"高级"中的"自解压文件选项"
d."常规"填写 “解压路径”(“C:\Program Files\chromeOpenIE”)(注:带上双引号)
e.“设置"填写"解压后运行”(“C:\Program Files\chromeOpenIE\install.bat”)(注:带上双引号)或者“设置"填写"解压后运行”(“C:\Program Files\chromeOpenIE\install.vbs”)(注:带上双引号)
f.“模式"勾选"隐藏启动对话框”
g.“高级"勾选"请求管理员密码”
h.“更新"覆盖方式中勾选"覆盖所有文件”
i.确定
注意:e,运行install.bat和install.vbs都可以达到效果,install.vbs不会出现控制台闪现,更友好,
3.执行chromeOpenIE.exe文件后 在html中执行 在路径前面拼chromeOpenIE:targetUrl;js跳转同理
<a href="chromeOpenIE:https://www.runoob.com/cssref/css3-pr-background.html">chrome打开IE</a>
4.前提
前提:IE的存放路径是默认的C:\\Program Files\\Internet Explorer\\iexplore.exe,如果手动调整过IE的存放路径,跳转将会失效
5.备注
若压缩时,绝对路径不加双引号,可能导致找不到路径,跳转将会失效
若需要直接下载exe,请点击下方链接获取
下载地址:s://download.youkuaiyun.com/download/mo_gui_jun/85241199chrome跳转到IE脚本-Javascript文档类资源-优快云下载