22
9
In Windows 7, Is it possible to define/change the proxy config from the command line?
So, using the GUI, I would go:
Start → Control Panel → Network and Internet → Internet Options → Connections → LAN Settings
and then
- enable/disable the proxy;
- define IP:port of proxy server.
But I would like to rather do this from the command line (so that I can run the command from a batch-file with a shortcut key — enabling me to switch proxy configs using a short-cut, rather than having to wade through the MS wizard).
I've looked at using netsh.exe
to change the settings for WinHTTP, but this seems to be thr wrong thing to do, as the WinHTTP setting do not appear to be related to the LAN settings.
For Windows 7 :Usage: set proxy [proxy-server=]<server name> [bypass-list=]<hosts list>
Parameters:
Tag Value proxy-server - proxy server for use for http and/or https protocol bypass-list - a list of sites that should be visited bypassing the proxy (use "<local>" to bypass all short name hosts)
Examples:
set proxy myproxy set proxy myproxy:80 "<local>;bar" set proxy proxy-server="http=myproxy;https=sproxy:88" bypass-list="*.foo.com" – Gerrie – 2014-03-04T06:42:12.337