Batch / BAT - Change proxy settings with a batch / BAT file

The proxy server settings for Internet Explorer are stored in the registry under Software\Microsoft\Windows\CurrentVersion\Internet Settings.

With Powershell (included with Windows since Windows 7) you could use:

set-itemproperty -path "hkcu:Software\Microsoft\Windows\CurrentVersion\Internet Settings" -name ProxyServer -value "http=proxy-url:port;https=proxy-url:port;ftp=proxy-url:port;socks=proxy-url:port;" -type string

This setting will only affect Internet Explorer and may require a new tab or maybe even a restart of IE, although that's unlikely.


Another option, if you don't want install Powershell, is to use the command REG.exe.

So, in that case you should add in your batch script:

REG ADD "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v ProxyServer /d "http=proxy-url:port;https=proxy-url:port;ftp=proxy-url:port;socks=proxy-url:port;" /t REG_SZ /f

For information, the proxy Internet Explorer settings are also used by Google Chrome