VBA Script to Change IE Settings Quickly!

If you are a regular reader of my site, you will know the problems I had been facing with HTTP Authentication and related problems associated with it that I was facing. I solved it using a local forwarding proxy named Delegate. I also have put the script to get Delegate to work properly. All and more you can read in my previous articles. Everything is working fine. But at times, I need to change from my local proxy to the office proxy since some of the internal websites require the connections to be forwarded from the office proxy. So I had to go to IE settings and turn off local proxy and turn on office proxy and vice-versa. Now IE being the most optimal browser (sarcasm) and my disdain for clicking made me write the below script. All it does is change the IE settings like I intend to. But you as a vivid reader can do a lot more with IE/System settings as you would like to (you know what I mean!).

Check it out, extend it and ENJOY!


dim oShell, regValue

set oShell = Wscript.CreateObject("Wscript.Shell")
regValue = oShell.RegRead ("HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ProxyEnable")

if regValue=1 then
	oShell.RegWrite "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ProxyEnable", 0, "REG_DWORD"
	oShell.RegWrite "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings\AutoConfigURL", "http://myoffice-proxy.com/", "REG_SZ"
  msgbox "Local Proxy - OFF, Office Proxy - ON"
else
	oShell.RegWrite "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ProxyEnable", 1, "REG_DWORD"
  oShell.RegDelete "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings\AutoConfigURL"  
  msgbox "Local Proxy - ON, Office Proxy - OFF"
end if

set oShell = nothing
set regValue = nothing