@echo off
title 自动设置代理服务器
:Runner
echo A 设置代理服务器
echo B 还原IE代理设置
set /p input=请输入选择:
REM if /i "%input%"=="A" goto setPROXY
REM if /i "%input%"=="B" goto cancelPROXY
REM 判断wifi是否需要代理
if "%input%"=="A" (
goto setPROXY
) else (
goto cancelPROXY)
cls &echo 你的输入不正确,请重新输入 &pause &goto Runner
:setPROXY
echo 【正在设置代理服务器……】
reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v ProxyEnable /t REG_DWORD /d 1 /f
reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v ProxyServer /d "127.0.0.1:8090" /f
reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v ProxyOverride /t REG_SZ /d "localhost;127.*;10.*;172.16.*;172.17.*;172.18.*;172.19.*;172.20.*;172.21.*;172.22.*;172.23.*;172.24.*;172.25.*;172.26.*;172.27.*;172.28.*;172.29.*;172.30.*;172.31.*;172.32.*;192.168.*" /f
echo 设置完毕
ipconfig /flushdns
start "" "C:\Program Files\Internet Explorer\iexplore.exe"
taskkill /f /im iexplore.exe
pause goto Runner
rem @echo off
:cancelPROXY
echo 【还原IE代理设置】
reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v ProxyEnable /t REG_DWORD /d 0 /f
reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v ProxyServer /d "" /f
echo 正在刷新设置……
ipconfig /flushdns
start "" "C:\Program Files\Internet Explorer\iexplore.exe"
taskkill /f /im iexplore.exe
pause goto Runner
exit
REM :exist