Windows系统通过bat脚本设置/清除代理

@echo off
taskkill /f /im iexplore.exe 1>nul 2>nul
::代理服务器地址跟端口
set ie_proxy=127.0.0.1:8080
::勾选为LAN使用代理服务器
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v ProxyEnable /t REG_DWORD /d 1 /f>nul
::设置代理服务器地址跟端口
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v ProxyServer /d "%ie_proxy%" /f>nul
::勾选对本地地址不使用代理服务器
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v ProxyOverride /t REG_SZ /d "<local>" /f>nul
echo 代理服务器设置完成
pause
@echo off
taskkill /f /im iexplore.exe 1>nul 2>nul
::取消勾选为LAN使用代理服务器
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v ProxyEnable /t REG_DWORD /d 0 /f>nul
::设置代理服务器地址跟端口为空
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v ProxyServer /d "" /f>nul
echo 代理服务器设置已清除
pause

未经允许不得转载:鹞之神乐 » Windows系统通过bat脚本设置/清除代理

赞 (0) 打赏

评论

8+4=

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

微信扫一扫打赏