Configuring proxy through batch file

July 2017



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


Published by aakai1056. Latest update on May 18, 2011 at 08:30 AM by aakai1056.
This document, titled "Configuring proxy through batch file," is available under the Creative Commons license. Any copy, reuse, or modification of the content should be sufficiently credited to CCM (ccm.net).