+ 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,188
    Thank Post
    81
    Thanked 261 Times in 233 Posts
    Rep Power
    78
    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
    12,416
    Thank Post
    1,682
    Thanked 2,035 Times in 1,480 Posts
    Blog Entries
    2
    Rep Power
    460
    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,850
    Thank Post
    110
    Thanked 598 Times in 514 Posts
    Blog Entries
    1
    Rep Power
    227
    Whats wrong with using auto detection aka pac files?

  5. #5

    FN-GM's Avatar
    Join Date
    Jun 2007
    Location
    UK
    Posts
    16,302
    Thank Post
    900
    Thanked 1,794 Times in 1,545 Posts
    Blog Entries
    12
    Rep Power
    465
    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
    16,302
    Thank Post
    900
    Thanked 1,794 Times in 1,545 Posts
    Blog Entries
    12
    Rep Power
    465
    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.403651, -0.515458
    Posts
    9,600
    Thank Post
    249
    Thanked 2,897 Times in 2,131 Posts
    Rep Power
    827
    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,185
    Thank Post
    62
    Thanked 235 Times in 177 Posts
    Rep Power
    176
    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,188
    Thank Post
    81
    Thanked 261 Times in 233 Posts
    Rep Power
    78
    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,916
    Thank Post
    231
    Thanked 899 Times in 774 Posts
    Rep Power
    303
    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
    29
    Thank Post
    7
    Thanked 2 Times in 2 Posts
    Rep Power
    11
    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, 01:25 AM
  2. Replies: 22
    Last Post: 2nd March 2011, 03:49 PM
  3. Replies: 0
    Last Post: 22nd November 2010, 11:23 AM
  4. Replies: 3
    Last Post: 21st June 2010, 04:45 PM
  5. Ranger - Change Proxy Settings
    By vlan2 in forum Network and Classroom Management
    Replies: 2
    Last Post: 14th September 2009, 12:05 AM

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
  •