Bat to enable and disable proxy

2

I need a bat to activate and deactivate proxy already with the set ips can anyone help me?

To activate use the following command:

REG ADD "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v ProxyEnable /t REG_DWORD /d 0x00000001 /f

Disable:

REG ADD "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v ProxyEnable /t REG_DWORD /d 0x00000000 /f

I need it already activated with the ip and the port that I want how do I?

    
asked by anonymous 23.01.2015 / 12:45

2 answers

1

For Google Chrome, you can use command-line options --proxy-server to use a specific proxy server and --no-proxy-server for direct connections.

The full list of command line options can be seen here .

For Internet Explorer you can create a .reg file and put this content:

Regedit4

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings]
"ProxyEnable"=dword:00000001
"ProxyServer"="http://<proxyEndereco>:<porta>"

See more details here .

In Batch you can do something like this:

@echo off

REG ADD "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v ProxyEnable /t REG_DWORD /d 1 /f
REG ADD "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v ProxyServer /t REG_SZ /d <proxyEndereco>:<porta> /f
    
23.01.2015 / 14:44
1

Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER \ Software \ Microsoft \ Windows \ CurrentVersion \ Internet Settings]

"ProxyOverride"=" HERE EXECUTIONS. *;

"

    
08.02.2015 / 00:13