By nsummersCreated 30 Jan 2013, Modified 17 Feb 2013
My Rating:
(1 votes)

Very Simple & Effective Proxy on/off Toggle Switch

Language:  VBScript


Windows XP Yes Windows 2003 Yes
Windows 2000 Yes Windows NT Yes
Vista Yes Windows 2008 Yes

The script will Toggle your Proxy on/off status. Simple as that. Perfect for users of Corporate Laptops which need the proxy on for work, and off for Public or Home LAN or WiFi Networks. Reduces the usual 7 clicks thorugh IE Settting to 1 click. Brings up a popup to tell you the status which disappears after 1 second. Change the timeout as you see fit. I've seen too many complicated Apps for configuration of Proxys, but all I wanted was a one click on/off toggle solution and this is what I've done. Hope you like it.


Line Numbers: On  Off      Plain Text
' Proxy Switcher VB Script for Windows
' Neil Summers 30 Jan 2013
' Recommend copy code to file Proxy Switcher.vbs and save to Desktop
' No Copyright - Freeware - Open Source - do what you want with it
' Maybe buy me a beer down my local if it's THAT good for you!
Option Explicit 
Dim WSHShell, strSetting
Set WSHShell = WScript.CreateObject("WScript.Shell")
'Determine current proxy setting and toggle to opposite setting
strSetting = wshshell.regread("HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ProxyEnable")
If strSetting = 1 Then 
 Else Proxy
End If
'Subroutine to Toggle Proxy Setting to ON
Sub Proxy 
WSHShell.regwrite "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ProxyEnable", 1, "REG_DWORD"
Set WshShell = Wscript.CreateObject("Wscript.Shell")
WshShell.Popup "Proxy On",1,"Proxy Status",64
End Sub
'Subroutine to Toggle Proxy Setting to OFF
Sub NoProxy 
WSHShell.regwrite "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ProxyEnable", 0, "REG_DWORD"
Set WshShell = Wscript.CreateObject("Wscript.Shell")
WshShell.Popup "Proxy Off",1,"Proxy Status",64
End Sub


Got a useful script? Click here to upload!


  Post Comment
Order By:  
User Comments
Be the first to post a comment!