Created
March 11, 2012 08:01
-
-
Save willwade/2015514 to your computer and use it in GitHub Desktop.
Toggle Proxy Server On/Off
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Const HKEY_CURRENT_USER = &H80000001 | |
strComputer = "." | |
Set objRegistry = GetObject("winmgmts:\\" & strComputer & "\root\default:StdRegProv") | |
strKeyPath = "SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings" | |
strValueName = "ProxyEnable" | |
objRegistry.GetDWORDValue HKEY_CURRENT_USER, strKeyPath, strValueName, dwValue | |
if dwValue=0 then | |
dwValue=1 | |
else | |
dwValue=0 | |
end if | |
objRegistry.SetDWORDValue HKEY_CURRENT_USER, strKeyPath, strValueName, dwValue | |
if dwValue=1 then | |
strValueName = "ProxyServer" | |
strValue = "10.33.172.51:8080" | |
objRegistry.SetStringValue HKEY_CURRENT_USER, strKeyPath, strValueName, strValue | |
strValueName = "ProxyOverride" | |
strValue = "<local>" | |
objRegistry.SetStringValue HKEY_CURRENT_USER, strKeyPath, strValueName, strValue | |
msg="ORS Proxy Enabled" | |
else | |
msg="ORS Proxy Disabled" | |
end if | |
msgbox msg,64,"Proxy Toggle" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment