- @echo off
- set proxy="HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings"
- set /p a=开启请按1,关闭请按2。
- if %a%==1 goto enable
- if %a%==2 goto disable
- :enable
- ::开启代理
- reg add %proxy% /v "ProxyEnable" /t REG_DWORD /d 1 /f>nul
- ::IP及端口
- reg add %proxy% /v "ProxyServer" /d "127.0.0.1:8087" /f >nul
- ::重启IE使代理生效
- ::taskkill /f /im iexplorer.exe
- ::start iexplorer.exe
- exit
- :disable
- reg add %proxy% /v "ProxyEnable" /t REG_DWORD /d 0 /f>nul
- reg add %proxy% /v "ProxyServer" /d "" /f >nul
- exit
转载于:https://blog.51cto.com/cskkxlj/817896