Forked from ReubenBond/Disable-AutomaticallyDetectSettings.ps1
Last active
September 5, 2018 20:18
-
-
Save jschlackman/f27af056f16215a6fefc8ffbf1a3fee5 to your computer and use it in GitHub Desktop.
Disable 'Automatically detect settings' in Internet Explorer's proxy settings dialog.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Disable 'Automatically detect proxy settings' in Internet Explorer. | |
# Read connection settings from Internet Explorer. | |
$regKeyPath = "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings\Connections\" | |
$conSet = $(Get-ItemProperty $regKeyPath).DefaultConnectionSettings | |
# Index into DefaultConnectionSettings where the relevant flag resides. | |
$flagIndex = 8 | |
# Bit inside the relevant flag which indicates whether or not to enable automatically detect proxy settings. | |
$autoProxyFlag = 8 | |
If ($($conSet[$flagIndex] -band $autoProxyFlag) -eq $autoProxyFlag) { | |
# 'Automatically detect proxy settings' was enabled, adding one disables it. | |
Write-Host "Disabling 'Automatically detect proxy settings'." | |
$mask = -bnot $autoProxyFlag | |
$conSet[$flagIndex] = $conSet[$flagIndex] -band $mask | |
$conSet[4]++ | |
Set-ItemProperty -Path $regKeyPath -Name DefaultConnectionSettings -Value $conSet | |
} Else { | |
Write-Host "'Automatically detect proxy settings' was already disabled." | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment