一、创建open.bat、open.reg、runreg.bat文件
1、创建open.bat
@echo off set m=%m:openChrome49:=% set m="%m:separator=&%" set m=%m:26%=&% start "" "C:\\Program Files\\openChrome49\\openChrome49\\GoogleChromePortable.exe" %m% exit
2、创建open.reg
Windows Registry Editor Version 5.00 [HKEY_CLASSES_ROOT\openChrome49] @="URL:openChrome49 Protocol" "URL Protocol"="" [HKEY_CLASSES_ROOT\openChrome49\DefaultIcon] @="GoogleChromePortable.exe,1" [HKEY_CLASSES_ROOT\openChrome49\shell] [HKEY_CLASSES_ROOT\openChrome49\shell\open] [HKEY_CLASSES_ROOT\openChrome49\shell\open\command] @="cmd /c set m=%1 & \"C:\\Program Files\\openChrome49\\openChrome49.bat\" %%m%% & exit"
3、创建runreg.bat
REGEDIT /S openChrome49.reg
二、创建完后,一定要双击open.reg运行,否则不会生效
三、实际使用
1、HTML
<el-button @click="openIE">打开IE</el-button> <el-button @click="openChrome88">打开Chrome49版</el-button>
2、JS
openIE(){ window.location.href = "openIE:" + 'http://192.168.120.180:8080/#/login' ;// 使用IE打开 }, openChrome88(){ window.location.href = "openChrome49:" + 'http://192.168.120.180:8080/#/login' ;// 使用IE打开 },
3、页面显示