Skip to content

Instantly share code, notes, and snippets.

@DosAmp
Created March 13, 2011 17:28
Show Gist options
  • Save DosAmp/868276 to your computer and use it in GitHub Desktop.
Save DosAmp/868276 to your computer and use it in GitHub Desktop.
Simple VBscript to toggle IE proxy usage
Dim wsh, enabled, antwort
Const PROXY_KEYNAME = "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ProxyEnable"
Set wsh = WScript.CreateObject("WScript.Shell")
enabled = wsh.RegRead(PROXY_KEYNAME)
dialogText = "Die Proxynutzung ist "
If enabled = 0 Then
dialogText = dialogText & "deaktiviert." & vbCrLf & _
"Möchten Sie sie aktivieren?"
Else
dialogText = dialogText & "aktiviert." & vbCrLf & _
"Möchten Sie sie deaktivieren?"
End If
antwort = MsgBox(dialogText, vbYesNo + vbQuestion)
If antwort = vbYes Then
enabled = 1 - enabled
wsh.RegWrite PROXY_KEYNAME, enabled, "REG_DWORD"
End If
Set wsh = Nothing
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment