What key in windows registry disables IE connection parameter “Automatically Detect Settings”?

后端 未结 11 1755
没有蜡笔的小新
没有蜡笔的小新 2020-12-04 18:15

I\'m trying to set all the connection settings in IE.

I\'ve found how to modify most of them, in the path :

HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\

11条回答
  •  一生所求
    2020-12-04 18:59

    I'm aware that this question is a bit old, but I consider that my small update could help other programmers.

    I didn't want to modify WhoIsRich's answer because it's really great, but I adapted it to fulfill my needs:

    1. If the Automatically Detect Settings is checked then uncheck it.
    2. If the Automatically Detect Settings is unchecked then check it.

      On Error Resume Next
      
      Set oReg   = GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\default:StdRegProv")
      sKeyPath   = "Software\Microsoft\Windows\CurrentVersion\Internet Settings\Connections"
      sValueName = "DefaultConnectionSettings"
      
      ' Get registry value where each byte is a different setting.
      oReg.GetBinaryValue &H80000001, sKeyPath, sValueName, bValue
      
      ' Check byte to see if detect is currently on.
      If (bValue(8) And 8) = 8 Then
          ' To change the value to Off.
          bValue(8) = bValue(8) And Not 8
      ' Check byte to see if detect is currently off.
      ElseIf (bValue(8) And 8) = 0 Then
          ' To change the value to On.
          bValue(8) = bValue(8) Or 8
      End If
      
      'Write back settings value
      oReg.SetBinaryValue &H80000001, sKeyPath, sValueName, bValue
      
      Set oReg = Nothing
      

    Finally, you only need to save it in a .VBS file (VBScript) and run it.

提交回复
热议问题