Snippets - IE Explorer Proxy Override

With this snippet, once configured will allow you to override your internet explorer proxy settings to connect and browse the internet with one double click of the mouse.
(this will shut the browser if it’s running, make the changes and launch it with the changed configuration)

Const HKEY_CURRENT_USER = &H80000001

strComputer = “.”
Set objRegistry = GetObject(“winmgmts:\\” & strComputer & “\root\default:StdRegProv”)

strKeyPath = “SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings”

strValueName = “ProxyEnable”
dwValue = 1
objRegistry.SetDWORDValue HKEY_CURRENT_USER, strKeyPath, strValueName, dwValue


‘ Place your company Proxy information here and Port number here

strValueName = “ProxyServer”
strValue = “http=my.intranetproxy.proxy.com:8080;https=my.intranetproxy.proxy.com:8080;ftp=my.intranetproxy.proxy.com:8080;gopher=my.intranetproxy.proxy.com:8080;”

objRegistry.SetStringValue HKEY_CURRENT_USER, strKeyPath, strValueName, strValue


‘ This section will allow you to place a proxy override url seperate url’s be semi colons.

strValueName = “ProxyOverride”
strValue = “<local>;*.my intranet . com” <– change me
objRegistry.SetStringValue HKEY_CURRENT_USER, strKeyPath, strValueName, strValue

strComputer = “.”
Set objReg = GetObject(“winmgmts:\\” & strComputer & “\root\default:StdRegProv”)


‘ this will allow you to change your start “home page” in IE Explorer

strKeyPath = “SOFTWARE\Microsoft\Internet Explorer\Main”
ValueName = “Start Page”
strValue = “http://myintranet.site.com” <– change me
objReg.SetStringValue HKEY_CURRENT_USER, strKeyPath, ValueName, strValue

Dim WSHShell
Set WSHShell = Wscript.CreateObject(“WScript.Shell”)
bat_file = “%systemroot%\system32\”
bat_file2 = “kill_ie.bat ” & mdl
cmd_bat = bat_file&bat_file2
‘Info = MsgBox (“bat_file = ” & bat_file & ” ” & cmd_bat & “”)
WshShell.Run cmd_bat,0,TRUE

Via http://www.bytemycode.com/snippets/snippet/804/1/