Submitted By: Paul Waite

Configures Internet Explorer proxy server settings based on the user location (on-campus or off-campus).

Visual Basic
Edit|Remove
Dim WshShell, strCurrentValue, strRegKey
Set WshShell = WScript.CreateObject("WScript.Shell")
 
strRegKey = "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ProxyEnable"
strCurrentValue = WshShell.RegRead(strRegKey)
intReturn = Msgbox("Are you on Campus?", _
    vbYesNoCancel, "Proxy Enable")
If intReturn = vbYes Then
    WshShell.RegWrite strRegKey, 1, "REG_DWORD"
End If
 
If intReturn = vbNo Then
    WshShell.RegWrite strRegKey, 0, "REG_DWORD"
End If

If intReturn = vbCancel Then
     Wscript.Quit
End If