8

Is there a way to print out Windows proxy setting via CLI accurately?

At the moment, I found 2 ways to do it, unfortunately when I compare with IE Lan Settings (GUI) it's not accurate.

netsh winhttp show proxy

or

reg query "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings" | findstr "ProxyServer AutoConfigURL"

Example 1

C:\>netsh winhttp show proxy

Current WinHTTP proxy settings:

    Proxy Server(s) :  x.x.x.x:8080
    Bypass List     :  (none)


C:\>

Example 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:\>

Actual Settings

enter image description here

1 Answer 1

2

Here -

(Get-ItemProperty -Path 'Registry::HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings')

It's Powershell code and returns everything about Proxy Settings, Plus If You Want any one property of numerous displayed in output just do this -

(Get-ItemProperty -Path 'Registry::HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings').ProxyEnable

as I wanted ProxyEnable Property.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .