Sab*_*ina 6 proxy command-line
有没有办法通过 CLI 准确打印出 Windows 代理设置?
目前,我找到了 2 种方法来做到这一点,不幸的是,当我与 IE Lan 设置 (GUI) 进行比较时,它并不准确。
netsh winhttp show proxy
Run Code Online (Sandbox Code Playgroud)
或者
reg query "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings" | findstr "ProxyServer AutoConfigURL"
Run Code Online (Sandbox Code Playgroud)
示例 1
C:\>netsh winhttp show proxy
Current WinHTTP proxy settings:
Proxy Server(s) : x.x.x.x:8080
Bypass List : (none)
C:\>
Run Code Online (Sandbox Code Playgroud)
示例 2
C:\>reg query "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings" | findstr "ProxyServer AutoConfigURL"
ProxyServer REG_SZ http=127.0.0.1:8888;https=127.0.0.1:8888
AutoConfigURL REG_SZ http://myproxyserver/wpad.dat
C:\>
Run Code Online (Sandbox Code Playgroud)
实际设置
小智 2
这里 -
(Get-ItemProperty -Path 'Registry::HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings')
Run Code Online (Sandbox Code Playgroud)
它是 Powershell 代码,并返回有关代理设置的所有内容,此外,如果您想要在输出中显示众多属性中的任何一个属性,只需执行以下操作 -
(Get-ItemProperty -Path 'Registry::HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings').ProxyEnable
Run Code Online (Sandbox Code Playgroud)
因为我想要 ProxyEnable 属性。