+ Post New Thread
Page 1 of 2 12 LastLast
Results 1 to 15 of 20
Scripts Thread, Changing Proxy Settings for home/work use in Coding and Web Development; Hi Guys, I'm after a script that will run in Windows 7/Vista, that basically changes unticks / ticks the Use ...
  1. #1

    Join Date
    Sep 2010
    Posts
    24
    Thank Post
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0

    Changing Proxy Settings for home/work use

    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\In ternet Settings\ProxyEnable", 1, "REG_DWORD"
    oShell.RegWrite "HKCU\Software\Microsoft\Windows\CurrentVersion\In ternet Settings\ProxyServer", "proxy.oldsch:8080", "REG_SZ"
    else
    oShell.RegWrite "HKCU\Software\Microsoft\Windows\CurrentVersion\In ternet Settings\ProxyEnable", 0, "REG_DWORD"
    end if

    Set oShell = Nothing


    Any help is extremely grateful..

  2. #2
    jamesreedersmith's Avatar
    Join Date
    Sep 2009
    Location
    Ruskington
    Posts
    1,155
    Thank Post
    78
    Thanked 253 Times in 227 Posts
    Rep Power
    76
    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!

  3. #3

    nephilim's Avatar
    Join Date
    Nov 2008
    Location
    Dunstable
    Posts
    11,839
    Thank Post
    1,624
    Thanked 1,883 Times in 1,399 Posts
    Blog Entries
    2
    Rep Power
    427
    A pac file would surely be better...if it can't find proxy, then it won't use one

  4. #4

    Geoff's Avatar
    Join Date
    Jun 2005
    Location
    Fylde, Lancs, UK.
    Posts
    11,803
    Thank Post
    110
    Thanked 583 Times in 504 Posts
    Blog Entries
    1
    Rep Power
    224
    Whats wrong with using auto detection aka pac files?

  5. #5

    FN-GM's Avatar
    Join Date
    Jun 2007
    Location
    UK
    Posts
    15,850
    Thank Post
    877
    Thanked 1,681 Times in 1,460 Posts
    Blog Entries
    12
    Rep Power
    445
    Quote Originally Posted by Geoff View Post
    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.

  6. #6


    Join Date
    Jan 2006
    Posts
    8,202
    Thank Post
    442
    Thanked 1,032 Times in 812 Posts
    Rep Power
    339
    Quote Originally Posted by FN-GM View Post
    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.

  7. #7

    FN-GM's Avatar
    Join Date
    Jun 2007
    Location
    UK
    Posts
    15,850
    Thank Post
    877
    Thanked 1,681 Times in 1,460 Posts
    Blog Entries
    12
    Rep Power
    445
    Quote Originally Posted by CyberNerd View Post
    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.

  8. #8


    Join Date
    Feb 2007
    Location
    51.405546, -0.510212
    Posts
    8,778
    Thank Post
    223
    Thanked 2,633 Times in 1,940 Posts
    Rep Power
    780
    Isn't the "Automatically detect settings" checkbox for WPAD and the "Use automatic configuration script" for PACs?

  9. #9


    Join Date
    Jan 2006
    Posts
    8,202
    Thank Post
    442
    Thanked 1,032 Times in 812 Posts
    Rep Power
    339
    Quote Originally Posted by Arthur View Post
    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

  10. #10

    HarryMonkey's Avatar
    Join Date
    Mar 2007
    Location
    Bedford
    Posts
    1,125
    Thank Post
    54
    Thanked 216 Times in 163 Posts
    Rep Power
    172
    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

  11. #11
    jamesreedersmith's Avatar
    Join Date
    Sep 2009
    Location
    Ruskington
    Posts
    1,155
    Thank Post
    78
    Thanked 253 Times in 227 Posts
    Rep Power
    76
    Some applications i have found wont work with a PAC file though due to bad coding!

  12. #12


    Join Date
    Jan 2006
    Posts
    8,202
    Thank Post
    442
    Thanked 1,032 Times in 812 Posts
    Rep Power
    339
    Quote Originally Posted by jamesreedersmith View Post
    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.

  13. #13


    Join Date
    Mar 2009
    Location
    Leeds
    Posts
    6,582
    Thank Post
    228
    Thanked 855 Times in 734 Posts
    Rep Power
    295
    I found after adding a wpad file all my pcs disappeared from wsus

  14. #14

    Join Date
    Sep 2010
    Posts
    24
    Thank Post
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0
    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

  15. #15

    Join Date
    Dec 2009
    Location
    Cranleigh, Surrey
    Posts
    27
    Thank Post
    6
    Thanked 2 Times in 2 Posts
    Rep Power
    10
    newdriftking-2008 Can you post the fixed code for others like me that are having the same issue?
    Thanks

SHARE:
+ Post New Thread
Page 1 of 2 12 LastLast

Similar Threads

  1. Changing proxy settings
    By s_tu in forum Windows Server 2008
    Replies: 6
    Last Post: 19th March 2011, 12:25 AM
  2. Replies: 22
    Last Post: 2nd March 2011, 02:49 PM
  3. Replies: 0
    Last Post: 22nd November 2010, 10:23 AM
  4. Replies: 3
    Last Post: 21st June 2010, 03:45 PM
  5. Ranger - Change Proxy Settings
    By vlan2 in forum Network and Classroom Management
    Replies: 2
    Last Post: 13th September 2009, 11:05 PM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •