Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have two networks at work and when I have to use my Wireless settings I need IE to use one set of Proxy LAN Settings, and when I am plugged in I need a different set.


I have been looking for a way to script in the Proxy Settings:

HTTP, FTP and Secure

I also need the "exemptions"

I can't buy anything....my company is in a buying pinch. And my IT guys groaned when I asked if I could install FireFox...because I was going to use Firefox for Wireless, IE for LAN....but they yelled at me.

Edit: I can't install anything for this. This is a "non issue" to my IT guys.
Edit: I have IE 8 installed

share|improve this question
    
Let me quess: you're not allowed to install any software to do this? –  Ivo Flipse Jul 30 '09 at 14:16
    
Oh and what version of IE do you have? –  Ivo Flipse Jul 30 '09 at 14:17
    
Owh did I mention that you probably need admin settings to get the "cool" solutions? –  Ivo Flipse Jul 30 '09 at 14:21
add comment

5 Answers

up vote 4 down vote accepted

Absolutely!

Almost all programs these days keep their settings within the registry somewhere. So if it is in the registry and you want to automate it you are in luck.

The first step is to find the registry keys that contain the specific configuration that you are going to automate. Once you have the registry keys identified, export those keys to a REG file type. Then write yourself a script which will call the .REG file from the command line.

The example REG file content below thanks to Ivo

Regedit4

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings]
"MigrateProxy"=dword:00000001
"ProxyEnable"=dword:00000001
"ProxyHttp1.1"=dword:00000000
"ProxyServer"="http://ProxyServername:80"
"ProxyOverride"="<local>"

An example to actually put the contents of the REG file within the registry is...

C:> REGSRV32 myregsettings.REG

If it prompts you for a response such as a Y/N question use the following example instead

C:> REGSRV32 myregistrysettings.REG < yes.txt

where yes.txt is you should create a text file which contains the Y character and a carriage return to complete the response.

share|improve this answer
1  
Axx, how about you add the registry part from my post to yours? That would make the most complete post! –  Ivo Flipse Jul 30 '09 at 14:24
    
Or look at this knowledge base: support.microsoft.com/?id=819961 –  Ivo Flipse Jul 30 '09 at 14:26
add comment

For little money there is Mobile Net Switch which can manage whole network setting profiles including proxy settings. I use it for some time and could not find any better (free) software.

share|improve this answer
add comment

Now I really hate network settings, so I can't guarantee it works.

Push the Browser Settings in the Login Script (for Internet Explorer)

Internet Explorer stores proxy settings in the registry. This makes it particularly easy to update, using a variety of methods. Even if your users do not normally use Internet Explorer as their usual browser, you will want to configure the proxy settings because many other applications key off proxy settings in Internet Explorer.

In this method, you determine the proper registry key for your version of IE, export the settings to a .REG file, and then use REGEDIT in the login script to push the settings to the PC.

To create the SETPXY.REG file, open notepad & type in as follows:

REGEDIT4 (or whatever version of REGEDIT is on your PC, such as REGEDT32)
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings]
"ProxyServer"="<your proxy IP address>:8080"
"ProxyEnable"=dword:00000001
"ProxyOverride"="<local>"

Change to the private IP address of your HTTP Proxy, and to 127.0.0.1 or any combination of URL's for which you want to bypass the proxy. (I advise you to experiment with this for a while to get the syntax done correctly).

Check this Knowledge Base post for more info on the registry part.

share|improve this answer
add comment

You should try a pac file. I asked this question on ServerFault.com.

Here is the answer I accepted:

Look into proxy auto-config scripts. You can script changes to the Windows registry to select a different proxy server, but you'll really like proxy auto-config scripts and how they work on your client computers.

http://en.wikipedia.org/wiki/Proxy_auto-config

I moved to proxy auto-config files for my school district Customer a couple of years ago as a result of administrators taking laptops off-site and trying to work on other networks that didn't need an HTTP proxy specified. It's worked like a charm, and is a nice cross-browser and cross-platform compatible solution.

share|improve this answer
add comment

Make a EnableProxy.bat file with the following content:

@reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /f /v ProxyEnable /t REG_DWORD /d 1

and DisableProxy.bat

@reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /f /v ProxyEnable /t REG_DWORD /d 0

This will just enable/disable the proxy, if you'd like to also change server address add another line to EnableProxy.bat

@reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /f /v ProxyServer /t REG_SZ /d your.proxy.server

Using REG enables you to change individual settings in a silent manner (/f switch) and it requires no UAC prompt (probably because this example only modifies HKCU).

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.