Jump to content

Recommended Posts

Posted

Hi Guys,

 

I'm after a script that will run in Windows 7/Vista, that basically changes unticks / ticks the Use a proxy server for your LAN.

 

lan_settings.png

 

 

This is to enable teachers at my schools to use the internet at home so that they don't keep clearing the proxy settings!

 

I have managed to create this one for XP, but it doesn't run in Win 7 or Vista..

 

dim oShell

set oShell = Wscript.CreateObject("Wscript.Shell")

 

if msgbox("Turn Proxy on?", vbQuestion or vbYesNo) = vbYes then

oShell.RegWrite "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ProxyEnable", 1, "REG_DWORD"

oShell.RegWrite "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ProxyServer", "proxy.oldsch:8080", "REG_SZ"

else

oShell.RegWrite "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ProxyEnable", 0, "REG_DWORD"

end if

 

Set oShell = Nothing

 

Any help is extremely grateful..

Posted
Whats wrong with using auto detection aka pac files? :)

 

Agreed, the best way to go. That way you dont need to mess about with this kind of thing.

Posted
Definitely - set everything to 'autodetect' and hey presto.

 

I used to push it out by group policy and leave the autodetect unchecked. If it cant find the .pac file it will not go through a proxy. I found having autodetect made a connect lag for a few seconds when you open up IE.

Posted
Isn't the "Automatically detect settings" checkbox for WPAD and the "Use automatic configuration script" for PACs? :confused:

 

same difference - symlink the dat file to the pac file on your webserver

Posted
Some applications i have found wont work with a PAC file though due to bad coding!

 

MACS !!

 

 

Edit:

I found macs hate wpad - pac fiels are fine. i posted too soon.

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

dim oShell

set oShell = Wscript.CreateObject("Wscript.Shell")

 

if msgbox("Do you want to turn the proxy on? (Yes for School and No for Home)", vbQuestion or vbYesNo) = vbYes then

oShell.RegWrite "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ProxyEnable", 1, "REG_DWORD"

oShell.RegWrite "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ProxyServer", "yourproxy and port", "REG_SZ"

oShell.RegWrite "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ProxyOverride", "yourproxy*.*", "REG_SZ"

else

oShell.RegWrite "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ProxyEnable", 0, "REG_DWORD"

end if

 

Set oShell = Nothing

 

Hope this helps....

Posted

Fixed! :)

 

dim oShell
set oShell = Wscript.CreateObject("Wscript.Shell")

if msgbox("Do you want to turn the proxy on? (Yes for School and No for Home)", vbQuestion or vbYesNo) = vbYes then
 oShell.RegWrite "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ProxyEnable", 1, "REG_DWORD"
 oShell.RegWrite "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ProxyServer", "[color="#FF0000"]yourproxy and port[/color]", "REG_SZ"
 oShell.RegWrite "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ProxyOverride", "[color="#FF0000"]yourproxy*.*[/color]", "REG_SZ"
else
 oShell.RegWrite "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ProxyEnable", 0, "REG_DWORD"
end if

Set oShell = Nothing

Guest TheLibrarian
Posted
Slightly off topic; I found this a few days ago, I haven't tried it so I have no idea if it's any good: IconZone.

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