查看和设置 Windows 的 WinHTTP 代理

用 netsh winhttp show proxy 查看系统级代理,用 set/reset 修改或还原。

Windows网络代理设置中风险
运行 `netsh winhttp show proxy` 查看当前 WinHTTP 代理;用 `netsh winhttp set proxy proxy-server="http=代理地址:端口"` 设置代理。

01命令

命令
$ netsh winhttp show proxy

02作用说明

WinHTTP 是系统服务和许多命令行工具使用的代理,与设置里面向用户的代理是分开的。netsh winhttp show proxy 可以看到是否配置了代理及其地址。公司管理的电脑常会设置它,残留的错误配置会让下载和更新悄悄失败。

03风险

风险中风险
使用条件Setting or resetting the proxy requires an administrator terminal.
!注意: 设置错误的代理会导致系统无法下载。用 `netsh winhttp reset proxy` 可恢复直连;设置和重置都需要管理员终端。

04撤销

撤销
$ netsh winhttp reset proxy

05来源

  • netsh
    Microsoft Learn · vendor-doc · 2026-09-17
    依据: Documents netsh WLAN commands including `netsh wlan show profile name=... key=clear` and `netsh wlan delete profile name=...`.
  • Netsh commands - Windows CMD
    SS64 · technical · 2026-09-17
    依据: Reference for netsh context commands such as wlan delete profile and winhttp proxy.

最后验证: 2026-09-18 · 分类: 网络

06相关方案