开启
@echo off
echoecho ======= 开始设置IE代理 ========
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v ProxyEnable /t REG_DWORD /d 1 /f
start iexplore.exe
ping 127.1 -n 1 >nul
@echo off
taskkill /im iexplore.exe /f
echo
echo ======= IE代理设置完成,正在关闭 =======
ping 127.1 -n 2 >nul
清除
@echo off
echo
echo ======= 开始清除IE代理设置 ========
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v ProxyEnable /t REG_DWORD /d 0 /f
start iexplore.exe
ping 127.1 -n 1 >nul
@echo off
taskkill /im iexplore.exe /f
echo
echo ======= IE代理清除完成,正在关闭 =======
ping 127.1 -n 2 >nul
更改
@echo off
echo 开始设置IE代理上网
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v ProxyEnable /t REG_DWORD /d 1 /f
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v ProxyServer /d "88.81.235.214:8080" /f
echo 代理设置完成按任意键关闭 (88.81.235.214:8080)
pause>nul
下面的单个文件可以实现开启和关闭
@echo off
reg query "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v ProxyEnable | findstr 0x0
IF %ERRORLEVEL% LEQ 0 ( echo ======= 开始设置IE代理 ========
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v ProxyEnable /t REG_DWORD /d 1 /f
start iexplore.exe
ping 127.1 -n 1 >nul
@echo off
taskkill /im iexplore.exe /f
echo
echo ======= IE代理设置完成,正在关闭 =======
ping 127.1 -n 2 >nul ) ELSE ( echo ======= 开始取消IE代理 ========
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v ProxyEnable /t REG_DWORD /d 0 /f
start iexplore.exe
ping 127.1 -n 1 >nul
@echo off
taskkill /im iexplore.exe /f
echo
echo ======= IE代理取消完成,正在关闭 =======
ping 127.1 -n 2 >nul )