Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@michal-m
Created February 17, 2012 13:05
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save michal-m/1853315 to your computer and use it in GitHub Desktop.
Save michal-m/1853315 to your computer and use it in GitHub Desktop.
Disable Compatibility View in Internet Explorer

IE-disable-compatibility-view.bat

This script disables Internet Explorer Compatibility View via registry.

The script is compatible with Internet Explorer 7+ (Windows XP+), including 64bit versions.

@ECHO off
SETLOCAL
:: let's get the IE version first
SET qry=REG QUERY "HKEY_LOCAL_MACHINE\Software\Microsoft\Internet Explorer" /v Version
SET fnd=FINDSTR /I /L /C:"REG_SZ"
FOR /f "Tokens=2*" %%u IN ('%qry%^|%fnd%') DO ( SET IEVerReg=%%v )
FOR /f "Tokens=1,2,3,4 Delims=." %%a IN ("%IEVerReg%") DO ( SET IEVerMaj=%%a&SET IEVerMin=%%b&SET IEVerBld=%%c&SET IEVerRev=%%d )
IF %IEVerMaj% EQU 9 IF %IEVerMin% GEQ 10 SET IEVerMaj=10
SET /a REG_VALUE=IEVerMaj*1000
REG ADD "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION" /v "iexplore.exe" /t REG_DWORD /d %REG_VALUE% /f
REG ADD "HKEY_CURRENT_USER\SOFTWARE\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION" /v "iexplore.exe" /t REG_DWORD /d %REG_VALUE% /f
:: 64bit Users
IF %PROCESSOR_ARCHITECTURE%==AMD64 (
REG ADD "HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION" /v "iexplore.exe" /t REG_DWORD /d %REG_VALUE% /f
REG ADD "HKEY_CURRENT_USER\SOFTWARE\Wow6432Node\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION" /v "iexplore.exe" /t REG_DWORD /d %REG_VALUE% /f
)
ENDLOCAL
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment