Skip to content

Instantly share code, notes, and snippets.

@jkbryan
Created October 2, 2018 20:49
Show Gist options
  • Save jkbryan/31eda4d601137e831ca5cf56913c91dd to your computer and use it in GitHub Desktop.
Save jkbryan/31eda4d601137e831ca5cf56913c91dd to your computer and use it in GitHub Desktop.
set-ie-vpn-proxies.vbs
OPTION EXPLICIT
Const HKEY_CURRENT_USER = &H80000001
Dim strComputer, objRegistry, strKeyPath, strValueName, arrValues, errReturn
strComputer = "."
Set objRegistry = GetObject ("winmgmts:\\" & strComputer & "\root\default:StdRegProv")
strKeyPath = "Software\Microsoft\Windows\CurrentVersion\Internet Settings\Connections"
strValueName = "RandomVPN1"
arrValues = Array(70,0,0,0,3,0,0,0,5,0,0,0,0,0,0,0,0,0,0,0,39,0,0,0,104,116,116,112,58,47,47,109,121,112,114,111,120,121,115,101,114,118,101,114,46,98,108,97,104,46,99,111,109,47,112,114,111,120,121,46,112,97,99,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)
'Translates to: Use automatic configuration script (ticked), plus http://myproxyserver.blah.com/proxy.pac as the proxy
errReturn = objRegistry.SetBinaryValue (HKEY_CURRENT_USER, strKeyPath, strValueName, arrValues)
strValueName = "RandomVPN2"
arrValues = Array(70,0,0,0,3,0,0,0,5,0,0,0,0,0,0,0,0,0,0,0,44,0,0,0,104,116,116,112,58,47,47,109,121,111,116,104,101,114,112,114,111,120,121,115,101,114,118,101,114,46,98,108,97,104,46,99,111,109,47,112,114,111,120,121,46,112,97,99,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)
'Translates to: Use automatic configuration script (ticked), plus http://myotherproxyserver.blah.com/proxy.pac as the proxy
errReturn = objRegistry.SetBinaryValue (HKEY_CURRENT_USER, strKeyPath, strValueName, arrValues)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment