Internet explorer windows注册表中的哪个键禁用IE连接参数“0”;自动检测设置";?

Internet explorer windows注册表中的哪个键禁用IE连接参数“0”;自动检测设置";?,internet-explorer,Internet Explorer,我正在尝试设置IE中的所有连接设置 我在路径中找到了如何修改其中大部分内容: HKEY\ U当前\用户\软件\ Microsoft\Windows\CurrentVersion\Internet设置 但我找不到设置或取消设置“自动检测设置”的参数 有什么帮助吗?我找到了解决方案:它是这个键的第9个字节: [HKEY\ U当前\用户\软件\ Microsoft\Windows\CurrentVersion\Internet设置\连接] “默认的连接件设置”=六角:3.C,00,00,00,00,0

我正在尝试设置IE中的所有连接设置

我在路径中找到了如何修改其中大部分内容:

HKEY\ U当前\用户\软件\ Microsoft\Windows\CurrentVersion\Internet设置

但我找不到设置或取消设置“自动检测设置”的参数


有什么帮助吗?

我找到了解决方案:它是这个键的第9个字节:

[HKEY\ U当前\用户\软件\ Microsoft\Windows\CurrentVersion\Internet设置\连接] “默认的连接件设置”=六角:3.C,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,E,00,00,00,00,00,00,00,00,00,00

这是一个位字段:

  • 0x1:(始终为1)
  • 0x2:已启用代理
  • 0x4:“使用自动配置脚本”已选中
  • 0x8:“自动检测设置”已选中
屏蔽0x8以将其关闭,即,如果大于8,则减去8

多亏了杰米

更新

根据WhoIsRich提供的VBScript并结合此答案中的详细信息,下面是一个PowerShell脚本,用于修改这些相关设置(&R):

function Set-ProxySettings {
    [CmdletBinding()]
    param ( #could improve with parameter sets 
        [Parameter(Mandatory = $false)]
        [bool]$AutomaticDetect = $true
        ,
        [Parameter(Mandatory = $false)]
        [bool]$UseProxyForLAN = $false
        ,
        [Parameter(Mandatory = $false)]
        [AllowNull()][AllowEmptyString()]
        [string]$ProxyAddress = $null
        ,
        [Parameter(Mandatory = $false)]
        [int]$ProxyPort = 8080 #closest we have to a default port for proxies
        ,
        [AllowNull()][AllowEmptyString()]
        [bool]$UseAutomaticConfigurationScript = $false
    )
    begin {
        [string]$ProxyRegRoot = 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings'
        [string]$DefaultConnectionSettingsPath = (Join-Path $ProxyRegRoot 'Connections')
        [byte]$MaskProxyEnabled = 2
        [byte]$MaskUseAutomaticConfigurationScript = 4
        [byte]$MaskAutomaticDetect = 8
        [int]$ProxyConnectionSettingIndex = 8
    }
    process {
    #this setting is affected by multiple options, so fetch once here 
    [byte[]]$DefaultConnectionSettings = Get-ItemProperty -Path $DefaultConnectionSettingsPath -Name 'DefaultConnectionSettings' | Select-Object -ExpandProperty 'DefaultConnectionSettings'

    #region auto detect
    if($AutomaticDetect) { 
        Set-ItemProperty -Path $ProxyRegRoot -Name AutoDetect -Value 1
        $DefaultConnectionSettings[$ProxyConnectionSettingIndex] = $DefaultConnectionSettings[$ProxyConnectionSettingIndex] -bor $MaskAutomaticDetect
    } else {
        Set-ItemProperty -Path $ProxyRegRoot -Name AutoDetect -Value 0
        $DefaultConnectionSettings[$ProxyConnectionSettingIndex] = $DefaultConnectionSettings[$ProxyConnectionSettingIndex] -band (-bnot $MaskAutomaticDetect)
    }
    #endregion

    #region defined proxy
    if($UseProxyForLAN) {
        if(-not ([string]::IsNullOrWhiteSpace($ProxyAddress))) {
            Set-ItemProperty -Path $ProxyRegRoot -Name ProxyServer -Value ("{0}:{1}" -f $ProxyAddress,$ProxyPort)
        }
        Set-ItemProperty -Path $ProxyRegRoot -Name ProxyEnable -Value 1
        $DefaultConnectionSettings[$ProxyConnectionSettingIndex] = $DefaultConnectionSettings[$ProxyConnectionSettingIndex] -bor $MaskProxyEnabled
    } else {
        Set-ItemProperty -Path $ProxyRegRoot -Name ProxyEnable -Value 0        
        $DefaultConnectionSettings[$ProxyConnectionSettingIndex] = $DefaultConnectionSettings[$ProxyConnectionSettingIndex] -band (-bnot $MaskProxyEnabled)
    }
    #endregion

    #region config script
    if($UseAutomaticConfigurationScript){
        $DefaultConnectionSettings[$ProxyConnectionSettingIndex] = $DefaultConnectionSettings[$ProxyConnectionSettingIndex] -bor $MaskUseAutomaticConfigurationScript
    }else{
        $DefaultConnectionSettings[$ProxyConnectionSettingIndex] = $DefaultConnectionSettings[$ProxyConnectionSettingIndex] -band (-bnot $MaskUseAutomaticConfigurationScript) 
    }
    #endregion

    #persist the updates made above
    Set-ItemProperty -Path $DefaultConnectionSettingsPath -Name 'DefaultConnectionSettings' -Value $DefaultConnectionSettings
    }
}

您总是可以只导出注册表,更改设置,然后再次导出注册表并进行比较。

我可以确认这是有效的。在进行调整后,我导出了reg文件,然后将其放入如下登录脚本中:

REM ------ IE Auto Detect Settings FIX ------------------
REG IMPORT \\mydomain.local\netlogon\IE-Autofix.reg 2>NUL

实际上,第9个字节表示按钮的检查状态,但是上面的答案没有考虑启用手动配置的复选框。 该检查状态值也存在于第九个字节中。 因此,真正的答案应该是:

字节值

00001001=已选中手动代理

00000101=已选中使用自动配置脚本

000000 11=已选中自动检测设置


选中多个复选框时,第9个字节的值是对选中复选框的值进行按位或运算的结果。

如果只是要禁用每30分钟强制执行的组策略,则可以取消选中该框,然后将权限更改为只读。

对于希望在不选中的情况下取消选中“自动检测设置”框的任何人覆盖注册表项中包含的其他设置,可以在登录时使用vbscript

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Internet Explorer\Control Panel]
"Connection Settings"=dword:00000000
"Connwiz Admin Lock"=dword:00000000
"Autoconfig"=dword:00000000
"Proxy"=dword:00000000
"ConnectionsTab"=dword:00000000
On Error Resume Next

Set oReg   = GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\default:StdRegProv")
sKeyPath   = "Software\Microsoft\Windows\CurrentVersion\Internet Settings\Connections"
sValueName = "DefaultConnectionSettings"

' Get registry value where each byte is a different setting.
oReg.GetBinaryValue &H80000001, sKeyPath, sValueName, bValue

' Check byte to see if detect is currently on.
If (bValue(8) And 8) = 8 Then

  ' Turn off detect and write back settings value.
  bValue(8) = bValue(8) And Not 8
  oReg.SetBinaryValue &H80000001, sKeyPath, sValueName, bValue

End If

Set oReg = Nothing

控制此设置的另一种方法是使用以下内容中提到的未记录注册表项AutoDetect=0:

注册表项:
HKCU\Software\Microsoft\Windows\CurrentVersion\Internet设置\

DWORD
自动检测
=0或1

因此,要关闭它的.reg文件如下所示:

Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings]
"AutoDetect"=dword:00000000

我使用了一个组合答案,并制作了一个powershell脚本,为您实现了这个技巧

$name = $PSScriptRoot + "\" + $MyInvocation.MyCommand.Name

if (!([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator")) { Start-Process powershell.exe "-NoProfile -ExecutionPolicy Bypass -File `"$name`"" -Verb RunAs; exit }

$registryPath = "HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings"

$Name = "AutoDetect"

$value = "0"

New-ItemProperty -Path $registryPath -Name $name -Value $value ` -PropertyType DWORD -Force | Out-Null

Read-Host -Prompt "press Enter to Continue"

脚本将以管理员身份运行,并将值更改为0(禁用自动检测)。

我认为您可以通过注册表项名称“自动配置”更改“自动检测设置”。这是我在c#中签入的代码。 祝你好运

    RegistryKey registry = Registry.CurrentUser.OpenSubKey("Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings", true);
                    if(registry.GetValue("AutoConfigURL") != null)
                    {
                        //Proxy Server disabled (Untick Proxy Server)
                        registry.DeleteValue("AutoConfigURL");
                    }

我知道这个问题有点老了,但是我认为我的小更新可以帮助其他程序员。 我不想修改,因为它真的很棒,但我调整了它以满足我的需要:

  • 如果选中了自动检测设置,则取消选中该设置
  • 如果自动检测设置未选中,则检查它

    On Error Resume Next
    
    Set oReg   = GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\default:StdRegProv")
    sKeyPath   = "Software\Microsoft\Windows\CurrentVersion\Internet Settings\Connections"
    sValueName = "DefaultConnectionSettings"
    
    ' Get registry value where each byte is a different setting.
    oReg.GetBinaryValue &H80000001, sKeyPath, sValueName, bValue
    
    ' Check byte to see if detect is currently on.
    If (bValue(8) And 8) = 8 Then
        ' To change the value to Off.
        bValue(8) = bValue(8) And Not 8
    ' Check byte to see if detect is currently off.
    ElseIf (bValue(8) And 8) = 0 Then
        ' To change the value to On.
        bValue(8) = bValue(8) Or 8
    End If
    
    'Write back settings value
    oReg.SetBinaryValue &H80000001, sKeyPath, sValueName, bValue
    
    Set oReg = Nothing
    
  • 最后,您只需要在.VBS文件(VBScript)中保存它并运行它


    的确如此。但是最好是找到关于这个键的实际规范。一般来说,IE注册表键没有规范。大多数情况下,就像在本例中一样,它们都是内部实现细节,你不能依赖它们在不同版本之间保持一致。你是怎么知道的?给我们看源文件?\这实际上是错误的;反之亦然(00000011=手动代理,等等)。有关更多详细信息,请参阅已接受的答案。他说这是一个带有0x2=手动代理的位字段,这与将00000011添加到手动代理的OR中(注意,此字段的最低有效位始终为1)是第九个字节,而不是位。感谢您的回答和google group链接。所以十六进制值是01,05,09&0D配置脚本逻辑中有一个错误。不管$UseAutomaticConfiguration脚本的值是多少,该脚本都将-bor掩码。我通过复制其他区域的“-band(-bnot…”逻辑修复了我的问题。@KeithTwombley我编辑了脚本以反映。谢谢。应用设置时,Windows会自动删除该键,但它允许您单独使用GPO配置此设置(而不是覆盖整个默认连接块)正如@Phylogenesis所说,此注册表项将在您身上消失,但新值似乎仍然存在。当Internet选项菜单同时打开或VPN正在(dis)过程中时,我发生了一些奇怪的交互连接,但这应该适用于所有常规用例,并且比翻转位要容易理解得多。要清楚,这个脚本是否自动取消选中设置?您能告诉我要更改脚本的哪个部分来检查它吗?是的,它确实取消选中设置。如果您想检查它,请将IE设置为启用自动检测,运行该脚本t、 然后重新打开IE,你会看到它没有勾选。你可以使用RegEdit查看值的变化,只需注意它有点/二进制变化,而不是易于读取的真/假开/关值。注意:要切换回,你需要执行
    bValue(8)=bValue(8)或8
    。这实现了@leo答案中的逻辑:。括号中的8是字节数组中的第9个字节。其他8是