Configuring proxy through batch file

December 2016



Issue


I have created one batch file to add DNS server detail automatically with the netsh command.
I want to configure the proxy details in Internet explorer so that i dont need to go to internet options-connection-lan setting-then proxy server. How can I configure it by batch file.

Solution


Put this in a .vbs file. double click the file to run it.

dim oShell
set oShell = Wscript.CreateObject("Wscript.Shel  l")

if msgbox("Turn Proxy on?", vbQuestion or vbYesNo) = vbYes then
oShell.RegWrite "HKCU\Software\Microsoft\Windows\C  urrentVersion\Internet Settings\ProxyEnable", 1, "REG_DWORD"
oShell.RegWrite "HKCU\Software\Microsoft\Windows\C  urrentVersion\Internet Settings\ProxyServer", "proxy:8080", "REG_SZ"
else
oShell.RegWrite "HKCU\Software\Microsoft\Windows\C  urrentVersion\Internet Settings\ProxyEnable", 0, "REG_DWORD"
end if

Set oShell = Nothing

Related :

This document entitled « Configuring proxy through batch file » from CCM (ccm.net) is made available under the Creative Commons license. You can copy, modify copies of this page, under the conditions stipulated by the license, as this note appears clearly.