Jump to content

Recommended Posts

Posted

Proxy switch "proxy on" & " proxy off" software / reg edit

 

Does any one know of a free piece of software to do this ? i have been through google and have not found anything suitable.

 

What i want to do is have on icon were staff can click and run a program on there laptops that will, in school use the proxy in internet explorer and at home will turn it off.

 

I know they can do this in the settings but, well, how do I put it.........erm ......it is a bit complicated for them. :wink:

 

Any help would be much appreciated.

 

Cheers Gav

Posted

I think someone posted something like this a while ago on a laptop thread.

 

It's doable in VBScript (create separate on/off shortcuts to it and using parameters for control) or an AutoIT with a basic GUI.

 

Edit: here's one I made earlier 8)

 

Set WSHSHell = WScript.CreateObject("WScript.Shell")
Dim Key,Phoenix,Redlist,ProxyServer,Args,Num,UseProxy

Key = "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings\"
Phoenix = "10.0.0.1:8080"
Redlist = "redlist.server.pavilion.net:1669"

ProxyServer = Phoenix


Set Args = WScript.Arguments
Num = Args.Count


If Num = 0 Then
  MsgBox "Usage: [CScript | WScript] proxy.vbs   " & vbCrLf & vbCrLf & "On|Off" & vbTab & vbTab & "-- Toggle access via proxy." & vbCrLf & "server:port" & vbTab & "-- Proxy server & port combo" & vbCrLf & "Yes|No" & vbTab & vbTab & "-- Confirmation of on or off message" & vbCrlf & vbCrLf & "i.e. 'proxy.vbs On 10.0.0.1:8080 Yes' to use proxy and display confirmation ", vbInformation, "Proxy"
  WScript.Quit 1
End If


For i = 0 to Num-1

Cmd = Args.Item(i)

Select Case Cmd

	Case "On":
  	UseProxy = TRUE
	
	Case "Off":
	UseProxy = FALSE

	Case "Yes":
	Confirm = TRUE
	
	Case "No":
	Confirm = FALSE
	
	Case Else:
	ProxyServer = Cmd

End Select 

Next


If UseProxy = TRUE Then

WshShell.RegWrite key & "ProxyEnable", 1, "REG_DWORD"
WshShell.RegWrite key & "ProxyServer", ProxyServer, "REG_SZ"
ConfirmText = "Internet access via proxy is enabled through:" & vbCrLf & vbCrLf & ProxyServer
ConfirmIcon = vbInformation
ConfirmCapt = "Proxy ON"

ElseIf UseProxy = FALSE Then

WshShell.RegWrite key & "ProxyEnable", 0, "REG_DWORD"
ConfirmText = "Internet access via proxy is turned *OFF*"
ConfirmIcon = vbCritical
ConfirmCapt = "Proxy OFF"

End If


If Confirm = TRUE Then

MsgBox ConfirmText, ConfirmIcon, ConfirmCapt

End If

Posted

I was looking at this a while ago and eventually came up with an easier solution. I've set the "Automatic Proxy Configuration URL" (in Firefox) and "Use Automatic Configuration Script" (in IE) to a script on our internal webserver, when in school the script can be found and the proxy is used, when not in school it can't and so is ignored.

 

function FindProxyForURL (url, host) {
 if ( host.match("intranet1|intranet2|intranet3).your.local.domain") || dnsDomainLevels(host) == 0 ) {
   return "DIRECT";
 } else {
   return "PROXY your.proxy.server:port; DIRECT";
 }
}

Posted

I was using ProxyPal which provided a toolbar button in IE, but found that if staff forgot to turn the proxy off before going home IE would hang for ages trying to access the proxy and the additional toolbar buttons do not show up until the first successful page load - so loads of complaints about 'You broke my internet at home!" etc despite explaining how to use it...

 

This is much better -

 

http://www.proxychanger.com/

 

Nice little system tray icon, simple UI, all you'll have to do is add your proxy and show them how to turn it on and off :)

Posted

Here is a VB script I use to enable / disable the proxy on staff laptops

 

Const HKEY_CURRENT_USER = &H80000001

intmsg = msgbox("CHANGE PROXY SETTINGS" & chr(13) & "ARE YOU AT HOME?",vbYesNo+vbQuestion,"WHERE ARE YOU?")

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

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")

 

Give a couple of popup messages too.

Posted

with the advanced proxy changer that I posted above it takes effect with currenty open IE windows as well, so no need to close down and re open :)

 

Proxy Changer is the same from what I have seen as well, both free too :)

Posted

do you know what version of dot net it needs to run smoothly, cos when I use it , It sometimes crashes out :-S

 

Ive already installed dot net 1.1 so am gonna try 2.0. Am guessing its 2.0

Posted

Just FYI, you can use a *local* proxy.pac which changes the proxy depending on the local domain/IP etc.

 

Having said that I never got mine past "experimental" so YMMV.

Posted

I use a very similar setting as Irazmus.

 

A proxy.pac file, stored on the school site. Teachers laptops point at this file in "Use Automatic Configuration Script". If their IP is on our range then they go through our proxy. If not they have direct access to the net.

 

Works a treat for all those who want to use their laptops for internet at home.

Posted

Call me anal but I wanted to make sure our staff were protected on staff laptops at home as well as in work.

 

So I

 

1. Disabled the proxy setting for staff,

2. Created a AD deploayable CMAK connection which installs tyo the machine at startup via a startup script.

 

That staff just needed to double click on and VPN icon on the desktop to VPN into the school.

 

3. the school proxy then became available and web access was then logged.

 

;-)

 

 

Just a different route you can go down.....

  • 4 months later...
Posted
I use a very similar setting as Irazmus.

 

A proxy.pac file, stored on the school site. Teachers laptops point at this file in "Use Automatic Configuration Script". If their IP is on our range then they go through our proxy. If not they have direct access to the net.

 

Works a treat for all those who want to use their laptops for internet at home.

I will probably get slapped for digging up old topics - but do you have the code for that pac file? :)

Posted
function FindProxyForURL(url, host)
{
var proxy_yes = "PROXY 192.168.0.1:8080";
var proxy_no = "DIRECT";

if (shExpMatch(url, "http://internal/*")) { return proxy_no; }
if (shExpMatch(url, "http://intranet/*")) { return proxy_no; }
if (shExpMatch(url, "https://intranet/*")) { return proxy_no; }
return proxy_yes;
}

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