Jump to content

Recommended Posts

Posted

Hey guys need some help here

 

 

Our ISP make us use a proxy, doesnt work without, teachers are having problem now getting the internet at home, some can get on, some cant because they forgot to take the proxy off or they dont know how to

 

is there a little app that can be made to select whether you are at home (to take the proxy off) and whether your at work (put proxy on)

 

anyone able to make something for this little problem, thanks

Posted (edited)

thanks, that should work, dont know why I couldnt find anything when I looked ages ago about this

 

 

+rep

 

but is there anything better, dont really want more programs running in the memory

 

a fair few teachers complain already there laptops run slow

 

Is it possible for some sort of icon setup?

 

One saying, home internet

Second saying, work internet

 

Double cick on one and it changess the settings has required

 

 

anyone able to make something like this?

 

So basiclly a registry file would do this, But cant have the yes no box coming up everytime

 

so really it needs to be an exe with some sort of home logo and business logo for each, so the user does not get confussed when doing this

 

needs to be idiot proof!!!!!!

 

its a shame for the vista computers, when you have the home or public or work selection coming up, it doesnt save these sort of settings with that, would be a good idea

Edited by pritchardavid
Posted (edited)

Edit to your requirements & compile [ AutoIT ] - will look like the picture under the script.

Will change the proxy settings and then launch IE. When run takes VERY little memory.

 

; 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)
$Button2 = GUICtrlCreateButton("Proxy Off", 120, 20, 89, 49)
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

Edited by mattx
  • Thanks 1
Posted (edited)

WE have exactly this it's just two shortcuts to a batch files on the c drive, that imports .REG files also on the c drive into the registy (bypasses warnings that confuse people).

 

will post it tommorow if someone else doesn't in the mean time...

 

You mentioned you already have the reg files for this, so to bypass the yes/no boxes. Find the batch command that imports reg files. place the bat file on c drive then jsut shortcut to it job done.

Edited by mossj
Posted (edited)

Thanks for your help

 

Copied your script has needed and edited for our proxy setting but keep getting this a message everytime when trying to make the exe

 

 

error: variable used without being declared

 

 

line 16

 

even a stright copy and paste and trying to make the exe doesnt work without editing something, so dont think its something im doing wrong

 

 

nope didnt make reg files, just saying that could be an option to use, but staff member would know what to do

but your way would work, i'll try to get the method above working first, if not, i'll try what you have then

Edited by pritchardavid
Posted

Just the sort of thing I'm after but I get this when I run it.

$BS_DEFPUSHBUTTON

variable used without being declared

 

I never really graduated from V2 am I doing something daft?

Posted
Our ISP make us use a proxy

 

Set up a transparent proxy between your network and the connection as provided by your ISP. We use Squid for this, running on a virtual machine.

 

--

David Hicks

Posted (edited)

Sorry, thats what you get for using old bits of code from other stuff I've written -

The lines [ 16 & 17 ] with the $Button1 & $Button var should read:

 

$Button1 = GUICtrlCreateButton("Proxy On", 10, 20, 89, 49)
$Button2 = GUICtrlCreateButton("Proxy Off", 120, 20, 89, 49)

 

Just tested it on my Windows 7 using version 3.3.0.0 & it works. [ Using just over 2 meg ] - which in my opinion is too much.....

If you want the GUI to close after they have clicked on the button, just add an 'Exit' in....

Edited by mattx
  • Thanks 1
Posted (edited)

For you - http://projects.localhosting.org.uk/proxySimples.zip

 

Should work, if you need it. Just follow the instuctions it's a bish bash bosh job really but it is exactly as you asked. 2 shortcuts on the desktop click one and the proxy is one way, click the other and it that way. Doesn't run in the background so no memory eaten.

 

Does require a browser restart but I expect all these scripts do...

Edited by mossj
Posted
Lordy Mossj, your license details are larger than the .reg & .bat files !!

 

Yup but the GNU seemed to state I had to include them somewhere :(

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...