IE Enable/Disable Proxy Server by using script file
Posted by in Internet, Tips And Tricks February 17, 2012 3 Comments

This article shows you the way of using script file written by Window Script to enable or disable Proxy Server in Internet Explorer.

I am in the situation like that. I have a laptop, when I use it to work in my company,I have to configure proxy server to access internet following company policy. After work, I go home,do something…an then usually using my laptop to surf internet for relaxing, but my Internet connection does need to use proxy, so I have to change, that makes me feel a a little bit inconvenience :(

You can refer this article witten by Mr Hoan named Fix Can Not Connect To Proxy Server In Firefox, Google Chrome And Internet Explorer to configure IE proxy server in wizard.

Now, I would like to give you the another way to configure Proxy Server.

Enable/Disable Proxy Server by using window scripting

I wrote a script as below

Option Explicit
Dim objShell, regProxyEnable, retMsg
regProxyEnable = "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ProxyEnable"
Set objShell = WScript.CreateObject("WScript.Shell")
On Error Resume Next
retMsg = MsgBox("Please select option :(Yes : Enable, No : Disable , Cancel : Do nothing)", _
         vbYesNoCancel, "Enable/Disable proxy server")
'Setvalue of ProxyEnable in registry(1 : enable, 0 : disable)
If retMsg = vbYes Then 'Enable
	objShell.RegWrite regProxyEnable, "1", "REG_DWORD"
	MsgBox "Proxy is enabled!"
	WScript.Quit
ElseIf  retMsg = vbNo Then ' Disable
	objShell.RegWrite regProxyEnable, "0", "REG_DWORD"
	MsgBox "Proxy is disabled!"
	WScript.Quit
End If

The main purpose of block code is using Window Script to set value of “ProxyEnable” in Registry.(0 : disable and 1 : enable)
The path is as below image

ProxyEnable in Registry Editor

ProxyEnable in Registry Editor

Enjoy this script in Window 7, IE 8 which I am using

I attached a script named “IE_EnableOrDisableProxySetting.vbs” at the bottom of this article. You can download  and place it on desktop to be easy running.

***Note*** :  Please remember to close IE before running this script.
IE before running script :

IE Proxy Server is enabling

IE Proxy Server is enabling

Perform running script to disable Proxy Server by double click on this script. Choose button “No” to disbale Proxy Server.

Run script to disable Proxy Server

Run script to disable Proxy Server

IE Proxy Server after running script, Proxy Server is changed to “Disable” status.

IE Proxy Server disabled after run script

IE Proxy Server disabled after run script

To enable Proxy Server again, run script and choose button “Yes”

Run script to  enable Proxy Server

Run script to enable Proxy Server

Hope it useful for you, I will do research about setting Firefox. Maybe the setting is similar way.:)

Download Script file above

  • http://4rapiddev.com/ Hoan Huynh

    It looks like a short cut to run a program. Actually, this is easier and more convenience than my way, hehe.

    Thank you Quynh.
    H2.

  • http://www.facebook.com/mdpathak Mahesh Pathak

    excellent man ,,.. thanks a tonne :-)

  • http://www.facebook.com/mdpathak Mahesh Pathak

    can u gv something for firefox ? easy like this