@echo off
taskkill /F /IM IEOpenerHost.exe /T >nul 2>nul
for %%N in (com.ie_mode_opener com.ie_mode_opener.tab) do (
  reg delete "HKCU\Software\Google\Chrome\NativeMessagingHosts\%%N" /f >nul 2>&1
  reg delete "HKCU\Software\Microsoft\Edge\NativeMessagingHosts\%%N" /f >nul 2>&1
  reg delete "HKCU\Software\Chromium\NativeMessagingHosts\%%N" /f >nul 2>&1
)
reg delete "HKCU\Software\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION" /v "IEOpenerHost.exe" /f >nul 2>&1
for %%V in (InternetExplorerIntegrationLevel InternetExplorerIntegrationSiteList InternetExplorerIntegrationReloadInIEModeAllowed) do (
  reg delete "HKCU\Software\Policies\Microsoft\Edge" /v "%%V" /f >nul 2>&1
)
rmdir /s /q "%LOCALAPPDATA%\IEModeOpener" 2>nul
echo Helper uninstalled and registry entries cleaned up.
if /i not "%~1"=="/silent" pause
