I'm am currently using js script between the *s below as follows:
*************************************************************************************************************************************
function KillIE()
{
var shell = new ActiveXObject("Shell.Application");
var wins = shell.Windows();
var e = new Enumerator(wins);
for (; !e.atEnd(); e.moveNext())
{
try
{
if(e.item().Document)
e.item().Quit();
}catch(ex){}
}
}
function ToggleProxy()
{
var KeyName = "HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings\\ProxyEnable";
var WshShell = new ActiveXObject("WScript.Shell");
var ProxyEnabled = WshShell.RegRead(KeyName);
var newValue = ProxyEnabled ? 0 : 1;
WshShell.RegWrite(KeyName,newValue,"REG_DWORD");
if(newValue == 0)
{
newValue = "IE set for Office";
}
else if(newValue == 1)
{
newValue = "IE set for Home";
}
WScript.Echo(newValue);
}
function LoadIE()
{
var IE = new ActiveXObject("InternetExplorer.Application");
IE.Visible = false;
}
KillIE();
ToggleProxy();
LoadIE();
*************************************************************************************************************************************
What this script does is toggle Internet Explorer (IE) Connections/LAN Settings/Proxy server either on or off.
The code I need to add/modify to the code above is to toggle between 1 of 2 ways as follows:
(1) Check mark both "Use a proxy server ... " and "Bypass proxy server ... " then add the appropriate IP address and Port to each server type.
(2) Check mark only "Use a proxy server ... " then add the appropriate IP address and Port to each server type.