newdriftking-2008 Posted October 11, 2011 Posted October 11, 2011 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. 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..
jamesreedersmith Posted October 11, 2011 Posted October 11, 2011 I export the reg key in ticked and unticked state then a couple of bat files that inport the reg keys as needed and bobs your fathers brother!
featured_spectre Posted October 11, 2011 Posted October 11, 2011 A pac file would surely be better...if it can't find proxy, then it won't use one
Geoff Posted October 11, 2011 Posted October 11, 2011 Whats wrong with using auto detection aka pac files?
FN-GM Posted October 11, 2011 Posted October 11, 2011 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.
CyberNerd Posted October 11, 2011 Posted October 11, 2011 Agreed, the best way to go. That way you dont need to mess about with this kind of thing. Definitely - set everything to 'autodetect' and hey presto.
FN-GM Posted October 11, 2011 Posted October 11, 2011 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.
Arthur Posted October 11, 2011 Posted October 11, 2011 Isn't the "Automatically detect settings" checkbox for WPAD and the "Use automatic configuration script" for PACs?
CyberNerd Posted October 11, 2011 Posted October 11, 2011 Isn't the "Automatically detect settings" checkbox for WPAD and the "Use automatic configuration script" for PACs? same difference - symlink the dat file to the pac file on your webserver
HarryMonkey Posted October 11, 2011 Posted October 11, 2011 What about this ... little app that sits in the system tray. Works on XP and W7 ... http://www.onyxbox.co.uk/software/downloads/ps.htm
jamesreedersmith Posted October 11, 2011 Posted October 11, 2011 Some applications i have found wont work with a PAC file though due to bad coding!
CyberNerd Posted October 11, 2011 Posted October 11, 2011 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.
sted Posted October 11, 2011 Posted October 11, 2011 I found after adding a wpad file all my pcs disappeared from wsus
newdriftking-2008 Posted November 2, 2011 Author Posted November 2, 2011 I have now managed to sort this issue out, seems there was a slight error in my VB script... Now it works on Windows 7 / Vista and XP
gomalley Posted November 15, 2011 Posted November 15, 2011 newdriftking-2008 Can you post the fixed code for others like me that are having the same issue? Thanks
newdriftking-2008 Posted November 17, 2011 Author Posted November 17, 2011 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....
Arthur Posted November 17, 2011 Posted November 17, 2011 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 November 17, 2011 Posted November 17, 2011 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.
pooley Posted November 17, 2011 Posted November 17, 2011 IE for school, use and firefox for home. Simples
box_l Posted November 17, 2011 Posted November 17, 2011 This works brilliantly, proxyswitch - Proxy Switch is a simple application to switch the system proxy settings in Windows on the fly. - Google Project Hosting. It works on the fly, no need to restart the browser at all. BoX
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now