Moving my LapTop between work and home I need to change my internet proxy settings. Is there any build in way for windows 7 to change these settings based on my currently active network?
A minimal PAC file that always sends you to the proxy server proxy.companyname on port 81:
And a slightly more complicated example of a PAC file that checks which network you're on by checking what IP address range you've picked up. In this example all client PCs in your company are given an IP address in the 10.10.* range by DHCP and access the internet via the proxy server proxy.companyname on port 81.
The script also has a debug mode that you can use to test that it is working and which mode (PROXY or DIRECT connect) it thinks your current connection should be.
You could also make a more complex script that checks things like if the server you're connecting to is on your internal company network (and thus wants a DIRECT connection, even though your PC is currently on the company network) this is where you'd put anything you normally put in IE's proxy exceptions box, by expanding it like so:
Use this file by saving it somewhere on your PC's C drive as something like proxy.pac, then for Internet Explorer, go to Tools -> Options (or Control Panel -> Internet Options) then click the Connections tab, click the LAN Settings button. Now take the tick out of the "Use a proxy server" box at the bottom, and instead put a tick in "Use automatic configuration script" and type in the address of your PAC file using a file:// URL like
Alternatively for Firefox go to Tools -> Options, click the Advanced tab, click the Network tab, click the Settings button, click the "Automatic proxy configuration URL" setting, again using a file:/// URL (note that in Firefox there are 3 slashes after the colon, eg
Note that Internet Explorer 11 has changed this behaviour and you now can't load a PAC file from a 'file://' URL, you must use an 'HTTP://' or 'HTTPS://' URL.
There is a work-around that can re-enable this feature for the moment, but you are not advised to use it, as future updates could disable this too.
Note also that after making this change IE11 you will need to change the address setting for your auto-config script as IE 11 only accepts one syntax for this (see the bottom of the linked article on the IE Internals blog below).
However, as noted, it is unlikely that this registry key workaround will continue to work in future versions of Internet Explorer, so you are much better off finding a way to hold the PAC on a web server. The Windows built-in IIS web server would do, and there are more minimal ones out there that would work for installing on your laptop too.
More info on the IE Internals blog entry Understanding Web Proxy Configuration.