I would like to enable/disable the Internet proxy settings with a powershell script.

cd HKCU:\"Software\Microsoft\Windows\CurrentVersion\Internet Settings"

$a = Read-Host "Enable proxy? (y/n)"

if ($a -eq "y")
{
  set-itemproperty . ProxyEnable 1
  Write-Host "Enabled"
}
else
{
  set-itemproperty . ProxyEnable 0
  Write-Host "Disabled"
}

This updates the registry but how do I tell applications that the settings have changed?

E.g. Chrome will not use the new settings until I go into the Internet Options/Connections dialog and press OK.

link|improve this question

feedback

1 Answer

up vote 0 down vote accepted

Finally found a solution here:

http://huddledmasses.org/setting-windows-internet-connection-proxy-from-c/

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.