Discussion Locked

Script to toggle IE "Use a Proxy Server"

0 helpful
6 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.
How can I implement a one click method to turn on/off Internet Explorer's "Use a Proxy Server" setting. It is found in Tools-> Internet Options-> Connections -> Lan Settings. I have not been able to find a good way to implement this.

6 replies

by stillatit

Will you settle for a double-click?

1. In IE, turn on proxy, and set the value of the proxy server.

2. In regedit, search for the proxy server value. This will be in a key which includes the user's sid (I think.) In my case, the key was:
[HKEY_USERS\S-1-5-21-430974686-799694419-646806464-1000\Software\Microsoft\Windows\CurrentVersion\Internet Settings]

3. Export the key to a .reg file.

4. Edit the resulting file to remove extraneous lines. The lines you need are:

REGEDIT4

[HKEY_USERS\S-1-5-21-430974686-799694419-646806464-1000\Software\Microsoft\Windows\CurrentVersion\Internet Settings]
"ProxyEnable"=dword:00000001
"ProxyServer"="192.168.0.99:80"

Note that you need the blank line after the REGEDIT4 line, and one at the end.

5. Save the edited file as "Proxyon.reg".

6. Change the 1 in the ProxyEnable line to a 0, and delete the IP address in the ProxyServer line so it looks like this:
"ProxyEnable"=dword:00000000
"ProxyServer"=""

Save the file as Proxyoff.reg

Double-clicking one or the other file should change the proxy setting. Note that you will probably have to do this for each user.

Note that the TECHREPUBLIC editor tends to put spaces into long strings. If you see any spacesin the [HKEY... lines, ignore them.

Good luck.

by jpirkle

I implemented this method prior to posting, and it is too cumbersome (I know, just one double-click, two clicks, and close then open the browser...) for my purpose, which is to roll it out to users in the field. I am envisioning something similar to the show desktop button on the quick launch bar. One simple click, and no need to close IE. I think that Windows Scripting or JavaScript is the key.
Thank you for your answer, though.

by jpirkle

This is very close. I wish to perform it natively (ie, without the helper program), but I think we are on the right track.

This discussion is closed to new replies.