Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

like image 661
BoDiE2003 Avatar asked Dec 27 '10 20:12

BoDiE2003


2 Answers

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

like image 40
Theus Avatar answered Sep 21 '22 08:09

Theus


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.

like image 112
Darcara Avatar answered Sep 20 '22 08:09

Darcara