@ECHO OFF & CD /D %~DP0
>NUL 2>&1 REG.exe query "HKU\S-1-5-19" || (
    ECHO SET UAC = CreateObject^("Shell.Application"^) > "%TEMP%\Getadmin.vbs"
    ECHO UAC.ShellExecute "%~f0", "%1", "", "runas", 1 >> "%TEMP%\Getadmin.vbs"
    "%TEMP%\Getadmin.vbs"
    DEL /f /q "%TEMP%\Getadmin.vbs" 2>NUL
    Exit /b
)

takeown /f %windir%\SysWOW64\ieframe.dll /a
cacls %windir%\SysWOW64\ieframe.dll /e /g administrators:f
takeown /f %windir%\SysWOW64\inetcpl.cpl /a
cacls %windir%\SysWOW64\inetcpl.cpl /e /g administrators:f
takeown /f %windir%\system32\ieframe.dll /a
cacls %windir%\system32\ieframe.dll /e /g administrators:f
takeown /f %windir%\system32\inetcpl.cpl /a
cacls %windir%\system32\inetcpl.cpl /e /g administrators:f
if exist %windir%\SysWOW64\ieframe.dllbak (del %windir%\SysWOW64\ieframe.dllbak /q & echo delete ieframe.dllbak success)
if exist %windir%\SysWOW64\inetcpl.cplbak (del %windir%\SysWOW64\inetcpl.cplbak /q & echo delete inetcpl.cplbak success)
if exist %windir%\system32\ieframe.dllbak (del %windir%\system32\ieframe.dllbak /q & echo delete ieframe.dllbak success)
if exist %windir%\system32\inetcpl.cplbak (del %windir%\system32\inetcpl.cplbak /q & echo delete inetcpl.cplbak success)
ren %windir%\SysWOW64\ieframe.dll ieframe.dllbak | echo ren ieframe.dllbak success
ren %windir%\SysWOW64\inetcpl.cpl inetcpl.cplbak | echo ren inetcpl.cplbak success
ren %windir%\system32\ieframe.dll ieframe.dllbak | echo ren ieframe.dllbak success
ren %windir%\system32\inetcpl.cpl inetcpl.cplbak | echo ren inetcpl.cplbak success
copy /Y 64\ieframe.dll %windir%\SysWOW64
copy /Y 64\inetcpl.cpl %windir%\SysWOW64
copy /Y 32\ieframe.dll %windir%\system32
copy /Y 32\inetcpl.cpl %windir%\system32
call "C:\Program Files\Internet Explorer\iexplore.exe"
