以下代码亲测有效,根据自己情况修改对应参数即可
注:pause参数为运行后不自动结束弹窗,便于报错观察,运行稳定可以删除此代码
@ECHO OFF
color 2f
mode con lines=20 cols=50
title 一键解决IE兼容性问题V1.0 By:yk
> "%Temp%.\DefOpen.reg" ECHO Windows Registry Editor Version 5.00
>>"%Temp%.\DefOpen.reg" ECHO.
>>"%Temp%.\DefOpen.reg" ECHO [HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\BrowserEmulation]
>>"%Temp%.\DefOpen.reg" ECHO "IntranetCompatibilityMode"=dword:00000001
>>"%Temp%.\DefOpen.reg" ECHO "MSCompatibilityMode"=dword:00000001
>>"%Temp%.\DefOpen.reg" ECHO.
>>"%Temp%.\DefOpen.reg" ECHO [HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\BrowserEmulation\ClearableListData]
>>"%Temp%.\DefOpen.reg" ECHO "UserFilter"=hex:41,1f,00,00,53,08,ad,ba,02,00,00,00,62,00,00,00,01,00,00,00,\
>>"%Temp%.\DefOpen.reg" ECHO 02,00,00,00,0c,00,00,00,9a,d6,c5,03,84,58,d9,01,01,00,00,00,0c,00,31,00,39,\
>>"%Temp%.\DefOpen.reg" ECHO 00,32,00,2e,00,31,00,36,00,38,00,2e,00,34,00,2e,00,32,00,38,00,0c,00,00,00,\
>>"%Temp%.\DefOpen.reg" ECHO f2,80,90,d8,71,72,d9,01,01,00,00,00,0d,00,31,00,39,00,32,00,2e,00,31,00,36,\
>>"%Temp%.\DefOpen.reg" ECHO 00,38,00,2e,00,34,00,2e,00,32,00,30,00,33,00
>>"%Temp%.\DefOpen.reg" ECHO.
START /WAIT REGEDIT /S "%Temp%.\DefOpen.reg"
START /WAIT REGEDIT /S "%Temp%.\DefOpen.reg"
DEL "%Temp%.\DefOpen.reg"
taskkill /f /t /im iexplore.exe 2>nul
echo ===============================================
echo ^| ^|
echo ^| ^|
echo ^| √. IE兼容性已修复完毕! ^|
echo ^| ^|
echo ^| 请先关闭浏览器再打开IE即可 ^|
echo ^| ^|
echo ^| By:yk ^|
echo ===============================================
pause
关于无法获取需要添加的对应站点参数,可以先用以下批处理获取到再运行上面脚本
获取IE模板兼容性参数配置
@echo off
if "%~n0" equ "兼容性视图设置" echo;重命名后再次运行&ping /n 2 0 >nul& exit
>nul reg export "HKCU\Software\Microsoft\Internet Explorer\BrowserEmulation\ClearableListData" "%tmp%\$.reg" /y
>"%tmp%\$.txt" more +7 "%~f0"
(type "%tmp%\$.txt"&type "%tmp%\$.reg")>兼容性视图设置.bat
echo;完成,运行生成的批处理文件即可修改兼容性视图设置
ping /n 2 0 >nul& exit
@echo off
>"%tmp%\t.reg" more +5 "%~f0"
regedit /s "%tmp%\t.reg"
echo;兼容性视图设置已修改,请重启IE浏览器
ping /n 2 0 >nul& exit
正文完