It completely depends on the program you are trying to use - in this case, pscp
. (cmd
itself does not have any proxy settings - it doesn't make any connections, only executes commands.)
pscp
is part of PuTTY, so it uses the same settings, which you can configure in PuTTY's GUI:
- Start PuTTY.
- In the configuration window, click Connection → Proxy, pick HTTP, configure the rest.
- Go back to Session, select Default Settings, and click Save.
pscp
should now use the proxy.
I don't know what protocol are you trying to use with Git -- if it's SSH, using user@host:path
or ssh://
, then it depends on the value of %GIT_SSH%
. If it is set to plink
, the above procedure applies.
For http://
, Git should honor %http_proxy%
. For git://
, you'll likely have to play with %GIT_PROXY_COMMAND%
.
In Windows 7 proxycfg.exe has been replaced with the netsh command. Netsh.exe is a command-line scripting utility that allows you to, either locally or remotely, display or modify the network configuration of a computer that is currently running. To setup a local machine proxy you would use the following syntax:
- open a command prompt in administrative mode (hit start globe, type
cmd, then hit Ctrl+Shift + Enter)
To set a proxy:
netsh winhttp set proxy [proxy server address:port number] [bypass list]
Example:
netsh winhttp set proxy "myproxy.proxyaddress.com:8484" "<local>;*.proxyaddress.com"
To check your proxy server setting:
netsh winhttp show proxy
To remove the proxy server setting:
netsh winhttp reset proxy
The netsh
command is interactive so you can always just type netsh and then the subsequent commands you need to save some key stroaks.
Important note: If you're running on a 64-bit OS, and want the proxy to be applied for 32-bit processes as well, you'll need to also modify your settings by running C:\Windows\SysWow64\netsh.exe
. This is caused by a bug in Windows 7's version of netsh.exe
, which doesn't write the registry values to the Wow6432Node
key. This bug seems to be fixed for Windows 10 (and probably Windows 8 as well)
Best Answer
The command-prompt doesn't need proxy settings. The programs you invoke from the command-prompt are what need proxy settings. Those programs will work the same as most GUI applications in that they'll either get them from the control panel (ie- system wide settings) or there will be some way to pass proxy parameters to the program or create a configuration for the program. Often a command-line program will get proxy information from an environment variable that you set for it. It's completely dependent on the program, though.
Is there a specific program that you're trying to configure to use a proxy?