Created
March 13, 2011 17:28
-
-
Save DosAmp/868276 to your computer and use it in GitHub Desktop.
Simple VBscript to toggle IE proxy usage
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
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