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\\
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:
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.