第1段代码:IE主页信任站点添加及关闭IE弹窗阻止
@
echo
off
:: BatchGotAdmin
:----------提取管理权限---------------------------
REM --> Check for permissions
>nul 2>&1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system"
REM --> If error flag set, we do not have admin.
if '%errorlevel%' NEQ '0' (
echo Requesting administrative privileges...
goto UACPrompt
) else ( goto gotAdmin )
:UACPrompt
echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%\getadmin.vbs"
echo UAC.ShellExecute "%~s0", "", "", "runas", 1 >> "%temp%\getadmin.vbs"
"%temp%\getadmin.vbs"
exit /B
:gotAdmin
if exist "%temp%\getadmin.vbs" ( del "%temp%\getadmin.vbs" )
pushd "%CD%"
CD /D "%~dp0"
:--------------------------------------
& mode 60,6 & color 0a
echo 1001 下载已签名的 ActiveX 控件
echo 1004 下载未签名的 ActiveX 控件
echo 1200 运行 ActiveX 控件和插件
echo 1201 对没有标记为安全的 ActiveX 控件进行初始化和脚本运行
echo 1405 对标记为可安全执行脚本的 ActiveX 控件执行脚本
echo 1406 通过域访问数据源
::echo 1607 跨域浏览子框架
::echo 2200 文件下载自动提示 **
::echo 2201 ActiveX 控件自动提示 **
reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\2" /v 1001 /t REG_DWORD /d 00000000 /f
reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\2" /v 1004 /t REG_DWORD /d 00000000 /f
reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\2" /v 1200 /t REG_DWORD /d 00000000 /f
reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\2" /v 1201 /t REG_DWORD /d 00000000 /f
reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\2" /v 1405 /t REG_DWORD /d 00000000 /f
reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\2" /v 1406 /t REG_DWORD /d 00000000 /f
reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\2" /v 1607 /t REG_DWORD /d 00000000 /f
::reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\2" /v 2200 /t REG_DWORD /d 00000000 /f
::reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\2" /v 2201 /t REG_DWORD /d 00000000 /f
::reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\2" /v CurrentLevel /t REG_DWORD /d 00000000 /f
reg delete "HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main" /v "Start Page" /f
reg add "HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main" /v "Start Page" /d "www.baidu.com" /f
reg add "HKCU\Software\Microsoft\Internet Explorer\Main" /v "Default_Page_URL" /t REG_SZ /d "www.baidu.com" /f
::REG_DWORD代表:0 启用,1 提示,3 禁止
::0x00000047 还原https复选框
reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\2" /v flags /t REG_DWORD /d 0x00000043 /f
reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap\Domains\******" /v http /t REG_DWORD /d 0x00000002 /f
reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap\Domains\******" /v http /t REG_DWORD /d 0x00000002 /f
reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap\Domains\**********" /v http /t REG_DWORD /d 0x00000002 /f
reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap\Domains\******" /v http /t REG_DWORD /d 0x00000002 /f
call:Kill_iexplore.exe
set "KEY=HKCU\Software\Microsoft\Internet Explorer\New Windows"
for /f "tokens=2*" %%a in ('reg query "%KEY%" /v PopupMgr') do set PDV=%%b
if "%PDV%"=="0x0" (set Value=1) else (set Value=0&set No=取消)
reg add "%KEY%" /v PopupMgr /t REG_DWORD /d %Value% /f
echo, & echo “启用弹出窗口阻止程序”已%No%勾选。
ping 127.0.0.1 -n "3">nul
exit
:Kill_iexplore.exe
cls & color 0c
tasklist | find /i "iexplore.exe" >nul && (
echo 发现您的 IE 浏览器正在运行,为了更好的进行配置,我将自动关闭所有 IE 进程,请先保存您在 IE 中的相关数据,然后在此窗口按任意键继续。
taskkill /f /im iexplore.exe
cls
)
pause>null
::--------------------------------------------------------------打开关闭-原始代码如下----------------------------------------------------------------------
title 弹窗阻止 - 开关 By (出处:百度知道-依梦琴瑶)
call:Kill_iexplore.exe
set
"KEY=HKCU\Software\Microsoft\Internet Explorer\New Windows"
for
/f
"tokens=2*"
%%a
in
(
'reg query "%KEY%" /v PopupMgr'
)
do
set
PDV=%%b
if
"%PDV%"
==
"0x0"
(
set
Value=1)
else
(
set
Value=0&
set
No=取消)
reg add
"%KEY%"
/v
PopupMgr
/t
REG_DWORD
/d
%Value%
/f
echo
, &
echo
“启用弹出窗口阻止程序”已%No%勾选。
ping
127.0.0.1 -n
"3"
>nul
exit
:Kill_iexplore.exe
cls & color 0c
tasklist |
find
/i
"iexplore.exe"
>nul && (
echo
发现您的 IE 浏览器正在运行,为了更好的进行配置,我将自动关闭所有 IE 进程,请先保存您在 IE 中的相关数据,然后在此窗口按任意键继续。
pause>nul
taskkill
/f
/im
iexplore.exe
cls
)
color 0a
goto :eof
::--------------------------------------------------------------关闭原始代码如下---------------------------------------------------------------------------------------
@
echo
off & mode 37,4 & color 0a
title 禁用弹出窗口阻止程序
set
"KEY=HKCU\Software\Microsoft\Internet Explorer\New Windows"
for
/f
"tokens=2*"
%%a
in
(
'reg query "%KEY%" /v PopupMgr'
)
do
set
PDV=%%b
if
not
"%PDV%"
==
"0x0"
(
call:Kill_iexplore.exe
reg add
"%KEY%"
/v
PopupMgr
/t
REG_DWORD
/d
0
/f
)
echo
, &
echo
已禁用弹出窗口阻止程序。
ping
127.0.0.1 -n
"3"
>nul
exit
:Kill_iexplore.exe
cls & color 0c
tasklist |
find
/i
"iexplore.exe"
>nul && (
echo
发现您的 IE 浏览器正在运行,为了更好的进行配置,我将自动关闭所有 IE 进程,请先保存您在 IE 中的相关数据,然后在此窗口按任意键继续。
pause>nul
taskkill
/f
/im
iexplore.exe
cls
)
color 0a
goto :eof