+ 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
    21
    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. IDG Tech News
  3. #2
    jamesreedersmith's Avatar
    Join Date
    Sep 2009
    Location
    Ruskington
    Posts
    1,021
    Thank Post
    75
    Thanked 225 Times in 199 Posts
    Rep Power
    61
    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!

  4. #3

    nephilim's Avatar
    Join Date
    Nov 2008
    Location
    Bedfordshire
    Posts
    8,299
    Blog Entries
    2
    Thank Post
    1,090
    Thanked 1,162 Times in 900 Posts
    Rep Power
    529
    A pac file would surely be better...if it can't find proxy, then it won't use one

  5. #4
    Geoff's Avatar
    Join Date
    Jun 2005
    Location
    Fylde, Lancs, UK.
    Posts
    11,736
    Blog Entries
    1
    Thank Post
    107
    Thanked 542 Times in 476 Posts
    Rep Power
    134
    Whats wrong with using auto detection aka pac files?

  6. #5

    FN-GM's Avatar
    Join Date
    Jun 2007
    Location
    UK
    Posts
    13,906
    Blog Entries
    8
    Thank Post
    728
    Thanked 1,372 Times in 1,202 Posts
    Rep Power
    363
    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.

  7. #6


    Join Date
    Jan 2006
    Posts
    7,767
    Thank Post
    422
    Thanked 966 Times in 750 Posts
    Rep Power
    308
    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.

  8. #7

    FN-GM's Avatar
    Join Date
    Jun 2007
    Location
    UK
    Posts
    13,906
    Blog Entries
    8
    Thank Post
    728
    Thanked 1,372 Times in 1,202 Posts
    Rep Power
    363
    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.

  9. #8


    Join Date
    Feb 2007
    Location
    51.405546, -0.510212
    Posts
    5,952
    Thank Post
    180
    Thanked 1,795 Times in 1,338 Posts
    Rep Power
    467
    Isn't the "Automatically detect settings" checkbox for WPAD and the "Use automatic configuration script" for PACs?

  10. #9


    Join Date
    Jan 2006
    Posts
    7,767
    Thank Post
    422
    Thanked 966 Times in 750 Posts
    Rep Power
    308
    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

  11. #10

    stevenewman's Avatar
    Join Date
    Mar 2007
    Location
    Northants
    Posts
    891
    Thank Post
    30
    Thanked 166 Times in 126 Posts
    Rep Power
    122
    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

  12. #11
    jamesreedersmith's Avatar
    Join Date
    Sep 2009
    Location
    Ruskington
    Posts
    1,021
    Thank Post
    75
    Thanked 225 Times in 199 Posts
    Rep Power
    61
    Some applications i have found wont work with a PAC file though due to bad coding!

  13. #12


    Join Date
    Jan 2006
    Posts
    7,767
    Thank Post
    422
    Thanked 966 Times in 750 Posts
    Rep Power
    308
    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.

  14. #13


    Join Date
    Mar 2009
    Location
    Leeds
    Posts
    4,760
    Thank Post
    170
    Thanked 642 Times in 555 Posts
    Rep Power
    204
    I found after adding a wpad file all my pcs disappeared from wsus

  15. #14

    Join Date
    Sep 2010
    Posts
    21
    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

  16. #15

    Join Date
    Dec 2009
    Location
    Cranleigh, Surrey
    Posts
    23
    Thank Post
    5
    Thanked 2 Times in 2 Posts
    Rep Power
    8
    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
  •