Sometimes when you are connected to vpn client and want to change the proxy settings , it can be done by opening IE --> Tools --> Internet Options --> Connection --> LanSettings and then enter the proxy setting.
We can automate these setting by below script. Just save the below code as .vbs extension , replace the MyProxy with your proxy server IP. Save it & double click on the file. Click Yes to enable & No to Disable the proxy. You are done !!!!!
dim oShell
set oShell = Wscript.CreateObject("Wscript.Shell")
if msgbox("Click Yes to 'Enable'| No to 'Disable'", vbQuestion or vbYesNo) = vbYes then
oShell.RegWrite "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ProxyEnable", 1, "REG_DWORD"
oShell.RegWrite "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ProxyServer", "MyProxy", "REG_SZ"
msgbox("Proxy is enabled")
else
oShell.RegWrite "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ProxyEnable", 0, "REG_DWORD"
msgbox("Proxy is disabled")
end if
Set oShell = Nothing
We can automate these setting by below script. Just save the below code as .vbs extension , replace the MyProxy with your proxy server IP. Save it & double click on the file. Click Yes to enable & No to Disable the proxy. You are done !!!!!
dim oShell
set oShell = Wscript.CreateObject("Wscript.Shell")
if msgbox("Click Yes to 'Enable'| No to 'Disable'", vbQuestion or vbYesNo) = vbYes then
oShell.RegWrite "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ProxyEnable", 1, "REG_DWORD"
oShell.RegWrite "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ProxyServer", "MyProxy", "REG_SZ"
msgbox("Proxy is enabled")
else
oShell.RegWrite "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ProxyEnable", 0, "REG_DWORD"
msgbox("Proxy is disabled")
end if
Set oShell = Nothing
Good one sir...
ReplyDeleteI was looking for this type of option in browser :)
Thanks.
Ultimate script man.
ReplyDeleteGreat Work!
ReplyDeletelots of time we are in need of such script.
Thank you... I was looking for this kind of script for long time.
ReplyDelete