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?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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
BrianKSCommented:
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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Web Browsers

From novice to tech pro — start learning today.