命令行设置IE代理

IE代理能够在注册表中设置,因此用DOS修改注册表,能够达到目的.
方法一:
注册表文件:
REGEDIT4
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings]
"ProxyEnable"=dword:00000001
"ProxyServer"="192.168.0.1:8088"
"ProxyOverride"="192.168.*"
保存为reg文件,如proxy.reg,而后在DOS中,导入注册表:
regedit /s proxy.reghtml

方法二:服务器

使用bat脚本处理ide

@echo off
echo 【修改IE】

rem “是否启用本地IE代理设置,值为1表示启用,勾选“为LAN使用代理服务器”前面的勾,值为0表示禁用,则不会勾选上
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v ProxyEnable /t REG_DWORD /d 1 /f

rem “设置代理服务器地址和端口号
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v ProxyServer /d "12.123.12.12:8080" /f

rem “对于本地地址不使用代理服务器”这个勾,不会勾选上
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v ProxyOverride /t REG_SZ /d "11.*;68.*;10.*;" /f

rem “对于本地地址不使用代理服务器”这个勾,会勾选上
::reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v ProxyOverride /t REG_SZ /d "11.*;68.*;10.*;<local>" /f

其中最下面的两行已经作了说明,我就不解释了。以下图spa

 

参考:
http://zhidao.baidu.com/question/42517242.html
http://zhidao.baidu.com/question/349423330.html代理

=================================================================================code

根据上面的知识,我写了个启用或禁用IE代理的脚步,方便在家里和公司的环境进行切换,代码以下htm

@echo off
echo 【修改IE代理设置】
set /p var=是否启用IE代理设置[Y/N]:
if /i %var%==Y (goto ProxyEnable) else (goto ProxyDisable)

:ProxyEnable
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v ProxyEnable /t REG_DWORD /d 1 /f
echo 你已启用IE代理
goto end

:ProxyDisable
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v ProxyEnable /t REG_DWORD /d 0 /f
echo 你已禁用IE代理
goto end

:end
Pause
相关文章
相关标签/搜索