公司的网络限制策略就像计划生育的政策一样...每次手动修改IE代理真让人烦燥
(192.168.75.80:808是代理地址)
存为proxy.ps1放入windows目录下,在cmd运行之,如果没有启动,运行脚本启用,反之关闭.爽
![](/Images/OutliningIndicators/ExpandedBlockStart.gif)
$enableProxy=Get-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings" -Name ProxyEnable
if($enableProxy.ProxyEnable -eq 1)
{
Write-Host "IE proxy is disabled"
Set-ItemProperty -path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings" -Name "ProxyEnable" -value 0
}
else
{
Write-Host "IE proxy is enabled"
Set-ItemProperty -path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings" -Name "ProxyEnable" -value 1
Set-ItemProperty -path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings" -Name "ProxyServer" -value "192.168.75.80:808"
}