@echo off
PUSHD %~dp0
color 0a
title IE浏览器自动安装程序
mode con: cols=60 lines=10
echo .>%windir%\test.txt
if exist %windir%\test.txt (
    del /f /q /a %windir%\test.txt>nul 2>nul
) else (
    cls
    echo.
    echo.
    echo    请右键◆以管理员身份运行◆本程序
    echo    按任意键退出...
    pause>nul
    exit
)
echo.
echo.
echo.
echo    请关闭已经打开的浏览器窗口，按任意键开始安装IE浏览器
pause >nul
taskkill /f /im IEXPLORE.EXE >nul 2>nul
setlocal enabledelayedexpansion
for /f "delims=" %%a in ('dir /a-d /b IE*-Windows*.exe 2^>nul') do (set str=%%a)
if exist !str! (
    !str! /passive /update-no /closeprograms /norestart
) else (
    cls
    echo.
    echo.
    echo    当前目录下没有发现 IE浏览器 安装程序
    echo    请放置后从新运行本程序
    ping -n 7 127.1 >nul
    exit
)
ping -n 1 127.1  >nul
regedit /s iesafe_v4.reg
cls
echo.
echo.
echo.
echo    已完成安装和设置
ping -n 4 127.1  >nul