批处理方式更改IE代理服务器

两个批处理文件,一个开启IE代理服务器,一个清除IE代理服务器。

当然,两个文件都要是bat格式哦

唯一要注意的是:开启的bat里,对于“本地地址不使用代理服务器”的勾选,是注册表键ProxyOverride控制的,其值含有“<local>“时,表示勾选“本地地址不使用代理服务器”。

以下是开启代码:

@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 "10.45.11.233:8080" /f

reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v ProxyOverride /t REG_SZ /d "10.*.*.*;192.168.*.*;<local>" /f

echo 正在刷新设置……

ipconfig /flushdns

关闭代理的代码:

@echo off

echo 【修改IE】

reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v ProxyEnable /t REG_DWORD /d 0 /f

reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v ProxyServer /d "" /f

reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v ProxyOverride /t REG_SZ /d "" /f

echo 代理服务器设置已经清空

echo 正在刷新设置……

ipconfig /flushdns

参考:

http://support.microsoft.com/kb/262981/zh-cn

http://zhidao.baidu.com/link?url=rQwTVnxXPy-C18B6-ajzI57B-jeQIrITpmI8Y3cBdz1_6AaffUTu8kMO-U8RtUdgBf8_MiVupAfX3-viVEDkT_

猜你喜欢

转载自dingherry.iteye.com/blog/2040368