如何从命令行Windows 7设置代理

问题描述 投票:2回答:2

我需要在Windows中使用命令行设置代理。

您对要执行的命令有什么想法吗?

先感谢您 。

powershell command-line proxy windows-7-x64
2个回答
2
投票

对我来说,前面的回答中没有上述内容也没有提出here(这是完全相同的,只是解释得更好)。

到目前为止,只有会话才有效,这个命令是:

(New-Object System.Net.WebClient).Proxy.Credentials =  
[System.Net.CredentialCache]::DefaultNetworkCredentials

从真正很好地解释here

然后我能够检索Web内容,例如:

Invoke-WebRequest http://example.org

1
投票

我相信它可能是https://superuser.com/questions/419696/in-windows-7-how-to-change-proxy-settings-from-command-line的副本

有一个名为set proxy的命令。请参阅以下内容:

set HTTP_PROXY=http://user:[email protected]:port

使用netsh

netsh winhttp set proxy  [proxy server address:port number] [bypass list]

另请参阅以下内容:

http://www.ehow.com/how_6887864_do-proxy-settings-command-prompt_.html

https://superuser.com/questions/337685/how-do-i-change-the-windows7-lan-proxy-config-from-the-command-line

© www.soinside.com 2019 - 2024. All rights reserved.