Batch / Bat - Change Proxy Settings with a Batch / Bat File

Batch / Bat - Change Proxy Settings with a Batch / Bat File

Could someone teach me please how to change proxy settings with a .bat file, or a suggestion? Honestly I can't find good information about.

I need a .bat file which will change my internet settings (Proxy) with a specific proxy ip and port.

Thank you

2 Answers

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.

1

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

3
Maya Lin-Takahashi
Author

Maya Lin-Takahashi

Maya is a hardware enthusiast who tests and reviews smart home devices, smartphones, wearables, and audio gear. She focuses on practical consumer value and build quality.