Code to enable/disable Internet Explorer "Automatically detect settings" connection option

Hello,
I need to write with VBScript language a little code to change the value of "Automatically detect settings" in IE connection tab.
I know that the value to change is contained in the registry string "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Connections", but I'm not able to write the rigth code.
Could you help me?
Thanks.
ie.jpg
SGSItAsked:
Who is Participating?
 
BrianKSConnect With a Mentor Commented:
This is something I found a while back:

The best way would probably be to set it on your computer, export the key, then enable it and export the key again. That way all of the other settings are set correctly to where you want them, and all you change is the value associated with the Autodetect Settings. Then, as needed, you can set the value to one or the other. Just use the values from your exported .reg files in your script in the appropriate places.
Everytime you turn the setting on or off it increments up by one. Setting it to an even number sets it to checked, odd numbers set it to unchecked.

Checked:
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Connections]
"DefaultConnectionSettings"=hex:3c,00,00,00,14,00,00,00,09,00,00,00,0e,00,00,\
00,31,32,37,2e,30,2e,30,2e,31,3a,38,30,38,30,09,00,00,00,6c,6f,63,61,6c,68,\
6f,73,74,0b,00,00,00,31,31,31,2e,31,31,2e,31,31,31,31,01,00,00,00,00,00,00,\
00,30,fd,35,de,8d,27,c6,01,03,00,00,00,c0,a8,01,73,c0,a8,b8,01,c0,a8,85,01,\
00,00,00,00,00,00,00,00
Unchecked
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Connections]
"DefaultConnectionSettings"=hex:3c,00,00,00,15,00,00,00,01,00,00,00,0e,00,00,\
00,31,32,37,2e,30,2e,30,2e,31,3a,38,30,38,30,09,00,00,00,6c,6f,63,61,6c,68,\
6f,73,74,0b,00,00,00,31,31,31,2e,31,31,2e,31,31,31,31,01,00,00,00,00,00,00,\
00,30,fd,35,de,8d,27,c6,01,03,00,00,00,c0,a8,01,73,c0,a8,b8,01,c0,a8,85,01,\
00,00,00,00,00,00,00,00  
0
 
rejoinderCommented:
There is a DOS command you can run...
open a command prompt and type:
reg add HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Connections /v DefaultConnectionSettings /t REG_BINARY /d 460000000300000100000000000000070000002a...and so on until you match all the hex in your registry entry
You could easily add something like this to a startup/login script.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.