Network Configuration via prompt

0

How do I disable the "Use automatic configuration script" checkboxes and also "Do not use proxy server for local addresses"?

To disable the proxy, I am using the command:

 "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v ProxyEnable /t REG_DWORD /d 0 /f

I would like to know how I can disable the other two checkboxes following the same idea of the command I already have. So I leave everything in a .bat

    
asked by anonymous 26.09.2017 / 16:05

2 answers

1

Create a file with the extension .reg (example: proxy.reg) with the following code:

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings]
"MigrateProxy"=dword:00000001
"ProxyEnable"=dword:00000001
"ProxyHttp1.1"=dword:00000000
"AutoDetect"=dword:00000000
"ProxyServer"="http://seu_servidor_proxy:80"
"ProxyOverride"=""

Here you enable or disable the proxy

Active

"ProxyEnable"=dword:00000001

inactive

"ProxyEnable"=dword:00000000

To re-enable the "Use automatic configuration script", modify the line

"AutoDetect"=dword:00000000

for

"AutoDetect"=dword:00000001

To re-enable "Do not use proxy server for local addresses", modify the

"ProxyOverride"=""

for

"ProxyOverride"="<local>"

And to put your .reg into a .bat is simple:

REGEDIT.EXE  /S  "proxy.reg"
    
26.09.2017 / 16:38
0

Do as follows:

dim oShell
set oShell = Wscript.CreateObject("Wscript.Shell")
configURL = "script_de_proxy"
configURL0 = ""

if msgbox("Navegar com Proxy?", vbQuestion or vbYesNo) = vbYes then
oShell.RegWrite "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings\AutoConfigURL", configURL, "REG_SZ"
else
oShell.RegWrite "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings\AutoConfigURL", configURL0, "REG_SZ"
end if

Set oShell = Nothing
    
08.11.2018 / 20:03