如何切换"使用自动配置脚本"

时间:2014-05-08 14:10:44

标签: internet-explorer

WhoIsRich发布了一个很棒的脚本来切换自动检测设置。你能告诉我如何设置使用自动配置脚本吗?原始发布在What key in windows registry disables IE connection parameter "Automatically Detect Settings"?

2 个答案:

答案 0 :(得分:2)

设置

reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v AutoConfigURL /t REG_SZ /d "http://www-abc.com:1234/sample.pac" /f

删除

这与取消选中“使用自动配置脚本”

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

答案 1 :(得分:0)

您可以在设置中保存代理,并使用此vbs脚本在关闭时切换代理..

Option Explicit
Dim WSHShell, strSetting
Set WSHShell = WScript.CreateObject("WScript.Shell")

'Determine current proxy setting and toggle to oppisite setting
strSetting = wshshell.regread("HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ProxyEnable")
If strSetting = 1 Then
NoProxy
Else Proxy
End If

'Subroutine to Toggle Proxy Setting to ON
Sub Proxy
WSHShell.regwrite "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ProxyEnable", 1, "REG_DWORD"
wScript.Echo "Proxy is On"
wScript.Sleep 2500	
wshShell.SendKeys "{TAB}"
wScript.Sleep 25000
wshShell.SendKeys "{ENTER}"


End Sub	



'Subroutine to Toggle Proxy Setting to OFF
Sub NoProxy
WSHShell.regwrite "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ProxyEnable", 0, "REG_DWORD"
wScript.Echo "Proxy is Off"
WScript.Sleep 2500
WshShell.SendKeys "{TAB}"	
WScript.Sleep 2500
WshShell.SendKeys "{ENTER}"
End Sub