+ Post New Thread
Page 1 of 2 12 LastLast
Results 1 to 15 of 16
Windows 7 Thread, Pac file in Technical; I am trying to create a pac file for our proxy server at work. Employees have laptops and when they ...
  1. #1

    Join Date
    Jun 2012
    Location
    USA
    Posts
    10
    Thank Post
    8
    Thanked 0 Times in 0 Posts
    Rep Power
    0

    Pac file

    I am trying to create a pac file for our proxy server at work.
    Employees have laptops and when they are at work. they use the proxy server settings.
    But they go home, they can't access Internet explore.

    I am trying to create a pac file that's going to let them use proxy server at work and then use
    automatic configuration script once they leave our subnet.

    Any one knows a good java script I can start with?

  2. #2
    carvjo's Avatar
    Join Date
    Mar 2010
    Location
    Oxford
    Posts
    195
    Thank Post
    12
    Thanked 39 Times in 34 Posts
    Rep Power
    22
    Hi FabIT - read this thread - there is a VBS that should do the job..

    Proxy vs. Home Use

  3. Thanks to carvjo from:

    FabIT (26th June 2012)

  4. #3

    HarryMonkey's Avatar
    Join Date
    Mar 2007
    Location
    Bedford
    Posts
    1,203
    Thank Post
    63
    Thanked 238 Times in 180 Posts
    Rep Power
    176
    function FindProxyForURL(url, host)
    {
    if (isInNet(myIpAddress(), "192.168.1.0", "255.255.255.0"))
    return "PROXY 192.168.1.1:8080";
    else
    return "DIRECT";
    }

    Put this into your pac file. Just substitute the appropriate IP addresses for yours and the proxy
    Last edited by HarryMonkey; 26th June 2012 at 03:37 PM.

  5. Thanks to HarryMonkey from:

    FabIT (26th June 2012)

  6. #4

    Join Date
    Jun 2012
    Location
    USA
    Posts
    10
    Thank Post
    8
    Thanked 0 Times in 0 Posts
    Rep Power
    0
    Thanks carvjo,

    So with the VBS file, is there something that needs to be install on the laptop as well?

  7. #5

    Join Date
    Jun 2012
    Location
    USA
    Posts
    10
    Thank Post
    8
    Thanked 0 Times in 0 Posts
    Rep Power
    0
    Carvjo,

    where do I place the VBS file?
    Last edited by FabIT; 26th June 2012 at 05:10 PM.

  8. #6
    carvjo's Avatar
    Join Date
    Mar 2010
    Location
    Oxford
    Posts
    195
    Thank Post
    12
    Thanked 39 Times in 34 Posts
    Rep Power
    22
    I keep a copy of this file on staff laptops - and start it with a shortcut in the 'all programs - startup' location.. or you could just give a shortcut on the desktop and tell those with these problems to run this VBS when at home..

  9. Thanks to carvjo from:

    FabIT (27th June 2012)

  10. #7

    Join Date
    Oct 2009
    Location
    Oldham, Lancs
    Posts
    34
    Thank Post
    1
    Thanked 7 Times in 6 Posts
    Rep Power
    12
    We had a similar problem with users taking their laptops home and not being able to use it.

    I wrote a VB program that ran at logon, automatically set the proxy, but asked the user if they wanted to 'work from home' and disabled the proxy settings.

    It assumes your at school unless you tell it otherwise, so you don't have to do anything if your at school, only press the I'm at Home button if your not in school. Worked quite well, tested on Win7, but should work easy enough on other Win OS's too.

    Its currently configured for our proxy settings but can easily be modified for your own settings..

    If you want a copy, let me know, ill dig it out

  11. Thanks to jonatkinson from:

    FabIT (27th June 2012)

  12. #8

    HarryMonkey's Avatar
    Join Date
    Mar 2007
    Location
    Bedford
    Posts
    1,203
    Thank Post
    63
    Thanked 238 Times in 180 Posts
    Rep Power
    176
    Not quite sure why you would need a script if you're using a pac file. If you want somthing for users to run and select then proxy switcher from Onyxbox is the answer, free and just sits in the system tray, needs no configuration and works with XP, Vista and W7.

    http://www.onyxbox.co.uk/software/downloads/ps.htm

  13. 2 Thanks to HarryMonkey:

    carvjo (27th June 2012), FabIT (27th June 2012)

  14. #9

    Join Date
    Oct 2009
    Location
    Oldham, Lancs
    Posts
    34
    Thank Post
    1
    Thanked 7 Times in 6 Posts
    Rep Power
    12
    Quote Originally Posted by stevenewman View Post
    Wish i'd known about this last year!

    I wasted all of nearly a whole hour writing my own.. I could have had 3 brews in that time.

  15. #10

    HarryMonkey's Avatar
    Join Date
    Mar 2007
    Location
    Bedford
    Posts
    1,203
    Thank Post
    63
    Thanked 238 Times in 180 Posts
    Rep Power
    176
    Quote Originally Posted by jonatkinson View Post
    Wish i'd known about this last year!

    I wasted all of nearly a whole hour writing my own.. I could have had 3 brews in that time.
    And at least half a pack of hobnobs.

  16. #11

    Join Date
    Jun 2012
    Location
    USA
    Posts
    10
    Thank Post
    8
    Thanked 0 Times in 0 Posts
    Rep Power
    0
    Thanks Jonatkinson,

    Yes please, send me a copy and I will modify it to fit my settings at work.

    It will work very much.
    Another thing is that I have never used a VB file to do proxy settings, but I am familiar with pac file.
    So all the help to customize it will be appreciated.

  17. #12

    Join Date
    Jun 2012
    Location
    USA
    Posts
    10
    Thank Post
    8
    Thanked 0 Times in 0 Posts
    Rep Power
    0
    Carvjo,

    I modified the VBscript U referred to me Proxy vs Home use. and I placed in the batch file.
    Still it didn't work. I tested it at work, but it didn't work. This is how I tested it === I unchecked the proxy server settings to see if I restart the internet explorer, that the check mark was going check marked itself.

  18. #13

    Join Date
    Jun 2012
    Location
    USA
    Posts
    10
    Thank Post
    8
    Thanked 0 Times in 0 Posts
    Rep Power
    0
    Steve,
    I installed it on my laptop ( currently using window 7) but it isn't working. When I try to open it, nothing happens.

  19. #14
    TheMan100's Avatar
    Join Date
    Dec 2010
    Posts
    156
    Thank Post
    8
    Thanked 15 Times in 15 Posts
    Rep Power
    11
    Quote Originally Posted by FabIT View Post
    Steve,
    I installed it on my laptop ( currently using window 7) but it isn't working. When I try to open it, nothing happens.
    Perhaps you need to upgrade .NET Framework?

  20. Thanks to TheMan100 from:

    FabIT (27th June 2012)

  21. #15

    Join Date
    Jun 2012
    Location
    USA
    Posts
    10
    Thank Post
    8
    Thanked 0 Times in 0 Posts
    Rep Power
    0
    This is the pac file I have, but it isn't working.
    Anyone see an error?


    function FindProxyForURL(url, host)
    {
    // variable strings to return
    //var proxy_yes = "PROXY 156.127.55.122:8080";
    var proxy_no = "DIRECT";

    // Minneapolis

    if (isInNet(myIpAddress(), "156.126.221.0", "255.255.255.0"))
    return "PROXY 156.127.121.222:8080";


    //Minneapolis2

    if (isInNet(myIpAddress(), "156.xxx.xx.x", "255.255.254.0"))
    return "PROXY 156.127.xx.xxx:xxx";

    else
    return "DIRECT";
    }



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

Similar Threads

  1. .pac file problem
    By mrbios in forum Scripts
    Replies: 3
    Last Post: 16th October 2009, 12:28 PM
  2. proxy .pac file
    By sted in forum Windows
    Replies: 12
    Last Post: 24th September 2009, 08:50 PM
  3. .pac files
    By jamiet147 in forum Coding
    Replies: 3
    Last Post: 26th November 2008, 09:51 AM
  4. Replies: 2
    Last Post: 29th April 2008, 04:17 PM
  5. Creating a PAC file
    By u8dmtm in forum Coding
    Replies: 4
    Last Post: 2nd March 2006, 04:49 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
  •