Jump to content

Recommended Posts

Posted

My aim is just for fun no commercial use or anything like that intended.

There is a free program called Free IP Switcher that does everything and more I believe.

 

Just nice to have a customized version :)

Posted

Strick in my two pennies worth - if anyone wants to hack away and change this for their setup then feel free - all very self explanatory - done in AutoIT this morning for a quick laptop I had to setup - will pop up a simple two button box, user clicks on what they want and the script does the rest. Compile as a .exe and you are away.

 

 

; AutoIt Version:  	3.2.0.1
; Language:        	English
; Platform:        	WinXP
; Author:          	Matt 
; Script Function: 	Proxy Switcher
; Version:			1.0
; Date:				Sept 2009

#include 

#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Proxy Switcher", 220, 110, 348, 309)
$helpmenu = GUICtrlCreateMenu("Help")
$infoitem = GUICtrlCreateMenuItem("About", $helpmenu)
GUISetBkColor(0x0066FF)
$Button1 = GUICtrlCreateButton("Proxy On", 10, 20, 89, 49, $BS_DEFPUSHBUTTON)
$Button2 = GUICtrlCreateButton("Proxy Off", 120, 20, 89, 49, $BS_DEFPUSHBUTTON)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
$nMsg = GUIGetMsg()
Select
	Case $nMsg = $Button1
		RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main", "First Home Page", "REG_SZ", "http://navaho")
		RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main", "Start Page", "REG_SZ", "http://navaho")
		RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings", "ProxyServer", "REG_SZ", "10.0.0.2:8080")
		RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings", "Proxyenable", "REG_DWORD", "1")
		RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings", "ProxyOverride", "REG_SZ", "intranet")
		Run('C:\Program Files\Internet Explorer\iexplore.exe')
		Exit
	Case $nMsg = $Button2
		RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main", "First Home Page", "REG_SZ", "http://www.google.co.uk")
		RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main", "Start Page", "REG_SZ", "http://www.google.co.uk")
		RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings", "Proxyenable", "REG_DWORD", "0")
		Run('C:\Program Files\Internet Explorer\iexplore.exe')
		Exit
	Case $nMsg = $infoitem
		MsgBox(0, "Proxy Switcher 1.0", "Written By Matt " & @CRLF & "Comments & Suggestions to:" & @CRLF & "matt@#######.org.uk")
EndSelect
Switch $nMsg
	Case $GUI_EVENT_CLOSE
		Exit
EndSwitch
WEnd

proxy.jpg

  • Thanks 1
  • 3 weeks later...
  • 4 weeks later...
Posted
For multiple proxies at home (for browsing), I use Firefox & FoxyProxy.

 

Does what I need it to do. :)

 

Chunks

 

I just discovered foxy proxy today.. Its great.. I have set bbc.co.uk/iplayer to be the proxy trigger and it activates the proxy so I can watch iplayer, but keeps the proxy off for all other browsing..

  • 2 weeks later...
  • 3 weeks later...
Posted

Hi Josh,

Did you ever post me that file to switch between home school proxy only i cant ever remember getting it !! It may just be me getting old, anyway have a good christmas fella.

 

Mark

  • 4 weeks later...
  • 1 month later...
Posted

hi i like you little proxy on off application, is there any chance of having a custom made version for our school i dont know if it is possible for 2 differant versions. one for staff laptops and one for school student laptops. my email is [email protected] or facebook me on the same email address. thanks for your help

 

Chris Cook

  • 3 months later...
Posted

i created a .vbs that we set on startup of all the laptops that ask are you at school, if they are it added in the proxy and enables it, if there not then it disables it. all that needs to be edited is <> and <>

 

Const HKEY_CURRENT_USER = &H80000001

 

Dim objShell2

Set objShell2 = WScript.CreateObject("WScript.Shell")

'objShell2.RegWrite RegLocate,"0","REG_DWORD"

objShell2.RegWrite "HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings\ProxyServer","<>:<>","REG_SZ"

 

intmsg = msgbox("Are you at School?",vbYesNo+vbQuestion,"Changing Proxy Settings")

 

if intmsg = vbyes then dwvalue = 1 else dwvalue = 0

 

strComputer = "."

Set objRegistry = GetObject("winmgmts:\\" & strComputer & "\root\default:StdRegProv")

 

strKeyPath = "SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings"

 

strValueName = "ProxyEnable"

objRegistry.SetDWORDValue HKEY_CURRENT_USER, strKeyPath, strValueName, dwValue

 

msgtxt = "The Proxy Server Has Been "

if dwvalue = 0 then msgtxt = msgtxt & "Disabled"

if dwvalue = 1 then msgtxt = msgtxt & "Enabled"

 

intmsg = msgbox(msgtxt,vbOKOnly+vbInfo,"Done")

Posted

Set oShell = WScript.CreateObject("WScript.Shell")

 

strComputer = "."

Set oWMIService = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & strComputer & "\root\CimV2")

Set colItems = oWMIService.ExecQuery("Select * From Win32_NetworkAdapterConfiguration Where IpEnabled = True")

'wscript.echo colitems.count

For Each objItem in colItems

If Not IsNull(objItem.DefaultIpGateway) Then

 

ip = join(objItem.IpAddress)

iparray = split(ip,".")

 

else

'wscript.echo "no ip for " & objItem.caption

End If

Next

 

will get your current IP, then you can automatically tell if you're on the school network (assuming you're on something unique-ish.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...