Sem palavras: -)
:: EnableProxy
@Echo off
set "Key=HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings"
Set "Val=ProxyEnable"
Set "Typ=REG_DWORD"
Reg add "%Key%" /v %Val% /t %Typ% /d "0x1" /f
:: Disable Proxy
@Echo off
set "Key=HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings"
Set "Val=ProxyEnable"
Set "Typ=REG_DWORD"
Reg add "%Key%" /v %Val% /t %Typ% /d "0x0" /f
:: ToggleProxy.cmd
@Echo off
set "Key=HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings"
Set "Val=ProxyEnable"
Set "Typ=REG_DWORD"
for /f "tokens=3" %%R in (
'Reg Query "%Key%" /v %Val% ^|find /i "%Val%"'
) do if "%%~R" equ "0x0" (
Reg add "%Key%" /v %Val% /t %Typ% /d "0x1" /f
) else (
Reg add "%Key%" /v %Val% /t %Typ% /d "0x0" /f
)
Eu escrevi um semelhante no StackOverflow para alternar entre dois proxies diferentes .