A script to remove the Internet Explorer Proxy setting.

If you have laptops in a network that environment that require a proxy setting when connected to the network to go on the internet or access resources etc, but when they go off site or home they need it removed. Im hoping this script will be for you. Im currently working on a better way but for now here is where im at.

VBS Script

The code below will change the proxy setting to off when it is ran. What you need to do is open a notepad file and copy the code below into it. Save the file with the extension .vbs not .txt

 

Dim objShell, Regkey
Set objShell = CreateObject("WScript.Shell")
Regkey = "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ProxyEnable"
objShell.RegWrite RegKey,"0","REG_DWORD"

The text in blue is where the registry setting is that needs to be changed. The option highlighted in red is 0 to turn the proxy server off or 1 to turn it on (unticked or ticked respectively).

Once you have the script saved as a vbs file. All you need to do now is attach it to a group policy so that it runs during logoff or shutdown depending on what you want. Then make sure its link to the group policy object that contains the computer you wish to have the script run on and then test. Make sure you test thoroughly though. I have not tested this on a network only locally so you do so at your own risk.

Additional Info

If you you wish to turn the proxy on using a script and add a server name and port in the options you can use the code below.

Dim objShell, Regkey, Regkey2
Set objShell = CreateObject("WScript.Shell")
Regkey = "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ProxyEnable"
objShell.RegWrite RegKey,"1","REG_DWORD"
Regkey2 = "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ProxyEnable"
objShell.RegWrite Regkey2, "<servername>:<portnumber>", "REG_SZ"

 

 




Disclaimer: By using any of the software mentioned in this document you are adhering to their terms and conditions of use. I do not accept any responsibility for any loss, damage or disruption to your data or computer system that may occur while using the software mentioned in this document.
Site Map | Privacy Policy | Contact Us
| Best viewed in 1024 * 768 or above | ©2008 www.MyPcHealth.co.uk