How to Configure Proxy Settings on Windows
Overview
Section titled “Overview”This article explains how to configure proxy settings on Windows, divided into user-level (WinINET) and system-wide (WinHTTP) settings.
For example: ProxyServer = http=<<PROXY_ADDRESS>>;https=<<PROXY_ADDRESS>> — environment-dependent values are denoted as <<variable>>.
Variable Notation
Section titled “Variable Notation”| Variable | Example | Description |
|---|---|---|
<<PROXY_ADDRESS>> | proxy.example.com:8080 | Proxy server hostname and port number |
<<PROXY_BYPASS>> | intranet.example.com;192.168.*;<local> | Domains, subnets, or local addresses to bypass the proxy (separated by ;) |
<<ADVPROXY_SETTINGS_PATH>> | C:\proxy-settings.json | Path to the advproxy configuration file |
Step 1: Understanding Proxy Types
Section titled “Step 1: Understanding Proxy Types”| Type | Target | Use Case |
|---|---|---|
| User-level (WinINET) | Logged-in users | Browser and user applications. Uses Internet Explorer/Edge proxy settings |
| System-wide (WinHTTP) | System account / OS level | Windows Update, BITS, Defender updates, and other system communications |
BITS (Background Intelligent Transfer Service) is used for background data transfer, including Windows Update and Defender definition updates.
Since it runs under the LocalSystem account, it does not inherit user-level (WinINET) proxy settings.
Step 2: Set User-Level Proxy with PowerShell
Section titled “Step 2: Set User-Level Proxy with PowerShell”$proxy = "<<PROXY_ADDRESS>>"Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings" ` -Name ProxyEnable -Value 1Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings" ` -Name ProxyServer -Value "http=$proxy;https=$proxy"Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings" ` -Name ProxyOverride -Value "<<PROXY_BYPASS>>"Verify:
Get-ItemProperty "HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings" | Select ProxyEnable, ProxyServer, ProxyOverrideStep 3: Configure System-Wide Proxy (WinHTTP / BITS)
Section titled “Step 3: Configure System-Wide Proxy (WinHTTP / BITS)”(1) Legacy Method (Windows Server 2019 or earlier)
Section titled “(1) Legacy Method (Windows Server 2019 or earlier)”netsh winhttp set proxy <<PROXY_ADDRESS>> "<<PROXY_BYPASS>>"netsh winhttp show proxy(2) Modern Method (Windows Server 2022 or later - Recommended)
Section titled “(2) Modern Method (Windows Server 2022 or later - Recommended)”Create JSON file:
@'{ "ProxyIsEnabled": true, "Proxy": "http=<<PROXY_ADDRESS>>;https=<<PROXY_ADDRESS>>", "ProxyBypass": "<<PROXY_BYPASS>>", "AutoConfigIsEnabled": false, "AutoDetect": false}'@ | Out-File "<<ADVPROXY_SETTINGS_PATH>>" -Encoding asciiApply configuration:
netsh winhttp set advproxy setting-scope=machine settings-file="<<ADVPROXY_SETTINGS_PATH>>"Alternatively, you can set it directly via command without JSON file (useful for testing or temporary environments):
netsh winhttp set advproxy setting-scope=machine settings='{\"ProxyIsEnabled\":true,\"Proxy\":\"http=<<PROXY_ADDRESS>>;https=<<PROXY_ADDRESS>>\",\"ProxyBypass\":\"<<PROXY_BYPASS>>\",\"AutoConfigIsEnabled\":false,\"AutoDetect\":false}'Step 4: Apply Proxy for BITS (LocalSystem Account)
Section titled “Step 4: Apply Proxy for BITS (LocalSystem Account)”bitsadmin /util /setieproxy localsystem MANUAL_PROXY <<PROXY_ADDRESS>> "<<PROXY_BYPASS>>"bitsadmin /util /getieproxy localsystemStep 5: Verification and Troubleshooting
Section titled “Step 5: Verification and Troubleshooting”netsh winhttp show proxyGet-ItemProperty "HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings" | Select ProxyEnable, ProxyServer, ProxyOverrideIf Windows Update fails through a proxy, disable AutoDetect and use the advproxy command format on Server Core.
Reset Proxy Settings
Section titled “Reset Proxy Settings”Reset User-Level (WinINET)
Section titled “Reset User-Level (WinINET)”Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings" -Name ProxyEnable -Value 0Remove-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings" -Name ProxyServer -ErrorAction SilentlyContinueRemove-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings" -Name ProxyOverride -ErrorAction SilentlyContinueReset System-Level (WinHTTP / advproxy)
Section titled “Reset System-Level (WinHTTP / advproxy)”netsh winhttp reset proxyFor Windows Server 2022 or later:
netsh winhttp set advproxy setting-scope=machine settings='{\"Proxy\":\"\",\"ProxyBypass\":\"\",\"AutoconfigUrl\":\"\",\"AutoDetect\":false}'Summary
Section titled “Summary”Windows provides two layers of proxy configuration: WinINET (user-level) and WinHTTP / advproxy (system-level).
- WinINET affects browsers and user apps (IE/Edge).
- WinHTTP / advproxy affects system services (Windows Update, BITS, Defender).
For Windows Server 2022 or later, advproxy is recommended, though winhttp remains backward compatible.
Using bitsadmin, you can correctly apply the proxy for LocalSystem operations.
Operational guidelines:
- Identify target layer (user or system).
- Configure corresponding proxy type (WinINET / WinHTTP).
- Use
advproxyon Server Core. - Use
reset proxy/reset advproxywhen cleaning up.
Proper configuration ensures reliable Windows Update, Defender updates, and BITS transfers even in proxy-restricted environments.