Introduction

This is a tiny utility which stores multiple network and proxy configuration as
profiles. You can apply a profile to set specific network setting and proxy
from simple shortcuts.

Background

If you have a laptop, when you go to different places, you have to change
Network configuration and browser proxy. I have to go to 4 different places
everyday with my laptop; my university, my offices and my home. Everywhere I
have to change my IP setting and IE Proxy. I could write a WMI Script to do all
of them. Unfortunately, for some reason WMI is not working from VB Script in my
laptop but somehow it is working from .NET. So, I have made a handy utility
which I can use to store configuration profiles for different places and apply
them very quickly just by pressing one key and a ENTER at system startup. This
program automatically sets IP, Subnet, Gateway and DNS for my LAN card and also
changes the IE Proxy setting.

Using the code

You can setup in 3 easy steps.

1. Click New and enter a profile name.

2. Set IP configuration

3. Set IE Proxy configuration

It’s even easier to use:

1. Press the first letter of your profile. For example, “h” for Home.

2. Press ENTER and wait as it applies the profile.

3. Press ESC to quit.

Points of Interest

It’s a very simple Winforms application written in C#. The key technologies are:

1. WMI

2. IE Registry tweaking

3. XML Serialization

WMI

Windows Management Intrumentation (WMI) helps you work with Network
configuration. For example, the following code retrieves Network Setting for a
given Network Card.

Comments and Discussions

I'm trying to make run the WMI_Helper class from asp.net 4.0 (deployed in windows xp with IIS 5.1) for configurate the network card remotely (like routers). I can show the IP, Subnet and Gateway, however when I run the method for DHCP or SetIP, the methods make nothing.

i am using windows 8 and the tool is not working. ip address is not changing. i have tried to run it as admin and it's not working. i also tried to use the code to change the ip address. in my case; we have system that got server connected to it, and vb.net application. my customer needs to connect to my system network to run the vb.net application and be apple to view the data from the server. so they have to reconfigure their laptop ip address to be able to connect to the server. not sure how ppl got job at chrysler, they have no idea how to change their network card ip address to static ip address, that's why i'm trying to add option to my application to change the ip address

can I implement this by
1.building & installing the service [runs under the LocalSystem account]
2.creating a small client that can be run in limited user mode that would command the service to change the network setting.

However, I still do not have any idea about how to command the service to change the network setting according to the input from the user [ in a winForm Program]

... (there is always a 'but'):
- Setting IP params always needs admin rights (XP and newer). Switching off UAC or even running your whole session as an admin is not an option. Think of bigger companies: Do you really want to grant local admin rights to all these users?
- Every IP address must respect its corresponding subnet mask, which will be different, depending the size of the subnet. You happen to be lucky as long as you're working on 24 bit subnets only, but as soon as it's no longer "255.255.255.0" everywhere you will need to pair every IP address with its own subnet mask.

Thanks for sharing your programming experience but nowadays such a tool shouldn't be needed anymore. A properly configured DHCP server should be setting your NIC when connecting to a network, and IE settings should be propagated automatically as shown for example on [Internet Explorer Automatic Configuration].

Great work... i customized and works well.
One question, why not populate the network card from the xml file? everytime query to the WMI takes time depending upon the system speed... i hope file operation would be more faster.

during new profile creation alone, the WMI can be queried... just an input..