Script to change network settings

These days I’m working from my client’s office for some part of the day and continue from my office for the remaining portion of the day. This requires me to change network settings on my windows XP Dell laptop (almost) every time I boot it. This was a painful activity that I wanted to somehow get away with. If you have encountered this pain too, then read on for details on a method that worked well for me.

Today I sat down to figure out how can that be simplified. 10 minutes of googling showed up a nice utility called “netsh” which was in c:\windows\system32 folder on my machine. It provided simple ways to dump/export existing network settings into a text file and re-load/import the same from it later if required. This was all that was required. I dumped my network’s settings into a text file and created a batch file through which it could be imported back. Did this for both the networks & I ended up with two nice short-cuts on my desktop which allow me to change from one network to another in 5 seconds.

Thanks Google.

The steps that I followed in order to do this were

a) Opened a Dos Window

b) Exported the current settings into a text file (network1.txt) by typing the following

netsh -c interface dump >> network1.txt

c) Created another text file called switch-to-network1.bat [Name could be anything, but extension should be bat]

d) Opened this file in Notepad (or any other text editor) and type in the following

netsh -f network1.txt

Make sure that the bat file & text file are in the same directory

e) Right click on the bat file, create a short-cut (if desired change its icon) and put it on your desktop.

Advertisements

3 thoughts on “Script to change network settings

  1. you can upgrade to Vista to get past this problem. Vista will automatically connect to any of the available & configured wireless networks (as per configured priority order).

  2. Thanks for your tip. If I’m not wrong, even XP can do this for wireless networks.

    However the description in my post would be helpful if the networks that you are connecting to are *not* wireless.

    — guneet

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s