Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings]
"ProxyServer"="xxx.xxx.xxx.xxx:xxxx"
"ProxyOverride"="<local>"
"ProxyEnable"=dword:00000001
.vbs 文件:
set wshshell = createobject("Wscript.shell")
WSHShell.RegWrite "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ProxyEnable", 1, "REG_DWORD"
WSHShell.RegWrite "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ProxyServer","192.168.001.250:80"
WSHShell.RegWrite "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ProxyOverride","<local>"
wshshell.popup "Proxy Example set.",3,"Messagebox"
设置代理设置:
.reg 文件:
.vbs 文件:
但为什么不使用组策略呢?
Internet Explorer 和 Google chrome 都共享相同的代理设置。因此,如果我们更改 Internet Explorer 中的设置,那么它也会影响 Google chrome。我们可以从 CMD(命令行提示符)更改代理设置。
禁用代理设置:
@ECHO 关闭
REG ADD "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet 设置" /v ProxyEnable /t REG_DWORD /d 0 /f
启用代理设置:
@ECHO 关闭
REG ADD "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet 设置" /v ProxyEnable /t REG_DWORD /d 1 /f
REG ADD "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v ProxyServer /t REG_SZ /d address:portNumber /f
address:新代理地址 portNumber:端口号
将命令保存在批处理文件中并执行。它将禁用/启用浏览器的代理设置。
http://langbasics.blogspot.in/2012/11/disable-or-enable-proxy-for-internet.html