Question : Internet Explorer "Auto Detect Settings"

Hi,

We are having the requirement to have the "Automatically Detect Settings" value checked in the internet Explorer connection tab. We have checked and found that the registry value which is responsible for the same is as below.
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Connections\DefaultConnectionSettings

The 9th value controls the "Automatically Detect Settings"as below
46,00,00,00,c5,0c,00,00,0b,00,00,00,0f,00,00,\
  00,31,30,2e,31,33,2e,30,2e,35,36,3a,38,30,38,30,1a,00,00,00,31,30,2e,2a,3b,\
  2a,2e,2a,2e,69,74,63,3b,6f,72,61,63,2a,3b,3c,6c,6f,63,61,6c,3e,6f,00,00,00,\
  66,69,6c,65,3a,2f,2f,43,3a,5c,44,6f,63,75,6d,65,6e,74,73,20,61,6e,64,20,53,\
  65,74,74,69,6e,67,73,5c,39,35,34,39,36,5c,41,70,70,6c,69,63,61,74,69,6f,6e,\
  20,44,61,74,61,5c,4a,75,6e,69,70,65,72,20,4e,65,74,77,6f,72,6b,73,5c,4e,65,\
  74,77,6f,72,6b,20,43,6f,6e,6e,65,63,74,20,36,2e,35,2e,30,5c,69,6e,73,74,61,\
  6e,74,70,72,6f,78,79,2e,70,61,63,05,00,00,00,00,00,00,00,20,0d,dc,4e,67,1e,\
  cb,01,00,00,00,00,00,00,00,00,00,00,00,00,01,00,00,00,02,00,00,00,0a,0a,04,\
  09,00,00,00,00,00,00,00,00,03,00,00,00,f8,20,e0,08,c8,27,38,0c,00,00,00,00,\
  00,00,00,00,01,00,00,00,6b,00,00,00,1d,00,00,00,24,0d,2e,0c,00,00,00,00,00,\
  00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,01,00,00,00,6b,00,00,00,1d,00,\
  00,00,03,00,00,00,00,00,00,00,00,00,00,00,6b,00,00,00,1a,00,00,00,00,00,00,\
  00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,80,3f,50,01,00,00

The value needs to be OB for keeping it ticked and 03 for uncheck.

We need a script to change only the 9th value and not all the values as those will change the other settings in internet explorer.

I have tried to use the below script to fetch the value but not happening.
Dim byteArray() As Byte

keyValue = "Software\Microsoft\Windows\CurrentVersion\Internet Settings\Connections"
regVersion = Registry.CurrentUser.OpenSubKey(keyValue, True)
byteArray = regVersion.GetValue("DefaultConnectionSettings", True)
regVersion.Close()
MsgBox(byteArray(0) & " " & byteArray(1) & " " & byteArray(2) & " " & byteArray(3) & " " & byteArray(4) & " " & byteArray(5))

Answer : Internet Explorer "Auto Detect Settings"

Unfortunately I cannot help you more ... It seems that this subroutine does the job (taken from the same thread) :

1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
'Example use of IEautomaticallydetect
 IEautomaticallydetect  "off"
 IEautomaticallydetect  "show"
 IEautomaticallydetect  "on"
 IEautomaticallydetect  "show"
 wscript.quit
 
 SUB IEautomaticallydetect (status)
 
 'howeasyisthat.com
 'The parameter shold be set to 'off', 'on' or 'show'.
 'This reads and writes to  HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Connections\DefaultConnectionSettings in order to
 'set or read the Internet Explorer Automatically Detect facility. When a proxy is set, this should normally be off. When no proxy settings are set,
 'it's usually best to have this setting turned on.[/size]
 
 DIM sKey,sValue,binaryVal
 Dim oReg
 Set oReg=GetObject( "winmgmts:{impersonationLevel=impersonate}!\\.\root\default:StdRegProv")    'For registry operations througout
 
 Const HKCU=&H80000001
 
 sKey = "Software\Microsoft\Windows\CurrentVersion\Internet Settings\Connections"
 sValue = "DefaultConnectionSettings"
 
 oReg.GetBinaryValue HKCU, sKey, sValue, binaryVal
 
 select case lcase(status)
   case "on"    binaryVal(8) = binaryVal(8) OR 8        'Force Autodetect on
   case "off"    binaryVal(8) = binaryVal(8) XOR 8        'Force Autodetect off
   case "show"    wscript.echo "Automatically detect is set to " & ((binaryVal(8) and 8) = 8)
   case else    wscript.echo "Invalid parameter - IEautomaticallydetect  on, off or show"
 end select
 
 if lcase(status)="on" or lcase(status)="off" then oReg.SetBinaryValue HKCU, sKey, sValue, binaryVal
 
 end sub
Random Solutions  
 
programming4us programming4us