Configure Windows Proxy Settings via Command Line
For any current Windows system, netsh winhttp is the standard command-line tool for proxy configuration. WinHTTP handles system-level proxy settings used by Windows Update, built-in applications, and services that don’t rely on browser-specific configuration.
Set a proxy with bypass list
netsh winhttp set proxy proxy-server="proxy.example.com:8080" bypass-list="localhost;127.0.0.1;*.internal.local"
Use semicolons to separate multiple proxy servers or bypass entries. Wildcards are supported for domain patterns (e.g., *.internal.local matches all subdomains).
View current settings
netsh winhttp show proxy
This displays the active proxy server and bypass list for WinHTTP.
Reset to direct connection
netsh winhttp reset proxy
This removes all proxy configuration and routes traffic directly.
Legacy Internet Explorer Configuration (Registry-Based)
If you’re maintaining older systems with Internet Explorer, direct registry modification is the most reliable approach. Modern SetProxy utilities are unsupported.
Enable proxy in IE
reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v ProxyServer /t REG_SZ /d "proxy.example.com:8080" /f
reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v ProxyEnable /t REG_DWORD /d 1 /f
The /f flag forces the operation without prompting.
Disable IE proxy
reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v ProxyEnable /t REG_DWORD /d 0 /f
Set exceptions (bypass list) in IE
reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v ProxyOverride /t REG_SZ /d "localhost;127.0.0.1;*.local" /f
Use semicolons to delimit entries.
Migrating IE Settings to WinHTTP
On Windows 7 or later, import existing IE proxy configuration into WinHTTP:
netsh winhttp import proxy source=ie
This copies IE’s proxy settings to the system-wide WinHTTP configuration. Useful when transitioning from browser-level to system-level proxy handling.
Verifying Proxy Configuration
Check WinHTTP settings
netsh winhttp show proxy
Query IE registry settings
reg query "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v ProxyServer
reg query "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v ProxyEnable
reg query "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v ProxyOverride
Key Differences: WinHTTP vs Internet Explorer
- WinHTTP: System-wide proxy settings affecting Windows Update, services, and applications that respect WinHTTP. Preferred for infrastructure automation.
- Internet Explorer: Browser-only settings. Only affects IE and older Windows components that query the registry directly.
- Modern Windows: Uses WinHTTP; IE is deprecated or removed entirely.
Advanced Proxy Configuration
Authenticated proxies
Command-line tools don’t directly support proxy authentication credentials. Instead, use one of these approaches:
-
PAC files: Deploy a proxy auto-config file and point to it via
netsh:netsh winhttp set proxy proxy-server="http://pac-server:8080/proxy.pac" - Credential storage: Store credentials in Windows Credential Manager and reference them in your automation scripts.
Domain environments
In Active Directory domains, use Group Policy to manage proxy settings centrally:
- Navigate to Computer Configuration > Administrative Templates > Windows Components > Internet Explorer or WinHTTP.
- Deploy settings to groups of machines without command-line intervention.
Multiple proxy servers
Specify different proxies for different protocols:
netsh winhttp set proxy proxy-server="http=proxy1.com:8080;https=proxy2.com:8443;ftp=proxy3.com:3128"
Bypass lists with wildcards
Separate entries with semicolons. Wildcards work with leading asterisks:
netsh winhttp set proxy proxy-server="proxy.example.com:8080" bypass-list="localhost;127.0.0.1;*.internal.local;*.dev;10.0.0.0/8"
Automation and Scripts
For scripted deployment, wrap netsh or reg commands in batch files or PowerShell:
# PowerShell example
$proxy = "proxy.example.com:8080"
$bypass = "localhost;127.0.0.1;*.internal.local"
netsh winhttp set proxy proxy-server=$proxy bypass-list=$bypass
For bulk deployment across multiple machines, use Configuration Management tools (Ansible, Puppet, Chef) or System Center Configuration Manager (SCCM).
2026 Comprehensive Guide: Best Practices
This extended guide covers Configure Windows Proxy Settings via Command Line with advanced techniques and troubleshooting tips for 2026. Following modern best practices ensures reliable, maintainable, and secure systems.
Advanced Implementation Strategies
For complex deployments, consider these approaches: Infrastructure as Code for reproducible environments, container-based isolation for dependency management, and CI/CD pipelines for automated testing and deployment. Always document your custom configurations and maintain separate development, staging, and production environments.
Security and Hardening
Security is foundational to all system administration. Implement layered defense: network segmentation, host-based firewalls, intrusion detection, and regular security audits. Use SSH key-based authentication instead of passwords. Encrypt sensitive data at rest and in transit. Follow the principle of least privilege for access controls.
Performance Optimization
- Monitor resources continuously with tools like top, htop, iotop
- Profile application performance before and after optimizations
- Use caching strategically: application caches, database query caching, CDN for static assets
- Optimize database queries with proper indexing and query analysis
- Implement connection pooling for network services
Troubleshooting Methodology
Follow a systematic approach to debugging: reproduce the issue, isolate variables, check logs, test fixes. Keep detailed logs and document solutions found. For intermittent issues, add monitoring and alerting. Use verbose modes and debug flags when needed.
Related Tools and Utilities
These tools complement the techniques covered in this article:
- System monitoring: htop, vmstat, iostat, dstat for resource tracking
- Network analysis: tcpdump, wireshark, netstat, ss for connectivity debugging
- Log management: journalctl, tail, less for log analysis
- File operations: find, locate, fd, tree for efficient searching
- Package management: dnf, apt, rpm, zypper for package operations
Integration with Modern Workflows
Modern operations emphasize automation, observability, and version control. Use orchestration tools like Ansible, Terraform, or Kubernetes for infrastructure. Implement centralized logging and metrics. Maintain comprehensive documentation for all systems and processes.
Quick Reference Summary
This comprehensive guide provides extended knowledge for Configure Windows Proxy Settings via Command Line. For specialized requirements, refer to official documentation. Practice in test environments before production deployment. Keep backups of critical configurations and data.

this is configure a system-wide static proxy. see:
https://docs.microsoft.com/en-us/windows/security/threat-protection/windows-defender-atp/configure-proxy-internet-windows-defender-advanced-threat-protection#configure-the-proxy-server-manually-using-netsh-command
https://stackoverflow.com/questions/2265163/is-it-possible-to-change-ie-proxy-settings-from-command-line