Home > Tutorial, Windows > Windows Quick Tip: How to Create a Batch File for Changing Network Settings

Windows Quick Tip: How to Create a Batch File for Changing Network Settings

by Shivaranjan on July 15, 2007

ADVERTISEMENTS

The aim of this tutorial is to create a batch file using which you will be able to change your network settings with just a click of your mouse.

Why to create a batch file for changing network settings?

If you happen to use a laptop at your workplace and at home the you may have to change the network settings when ever you move from home or office. The normal procedure where we usually open the network connections and enter the IP address manually is painful if we do it daily. To get this done easily all you have to do is create two batch files which will ease our task.

How to create a batch file for changing network settings?

1. Open notepad.

2. Now copy the code that is given below

netsh interface ip set address name="Local Area Connection" source=static addr=192.168.1.100 mask=255.255.255.0
netsh interface ip set address name="Local Area Connection" gateway=192.168.1.1 gwmetric=0
netsh interface ip set dns name="Local Area Connection" source=static addr=208.67.222.222
netsh interface ip add dns name = "Local Area Connection" addr =208.67.220.220

The relevant IP’s are illustrated in the screenshot below, the IP’s that are illustrated are only examples:

network1

3. Now that you have copied the code, paste this in the Notepad. Enter the IP’s as per your requirements and save the file with the extension *.bat

[eminimall]

4. Your batch file is now ready for execution, now double click the batch file that you just created and you will find your network settings configured in a few seconds.

5. Create another batch file using the similar procedure, in this batch file you enter the IP’s that are relevant to your other location.

6. Now you should be having two batch files one for your office network and the other for your home network.

I guess by using this method your life would ease a bit. :) If you have better method then do let me know.

Did you enjoy this article? Please subscribe to RSS Feed to receive all the updates!

Related Posts:

  • No related posts found

{ 1 comment… read it below or add one }

Mark January 27, 2014 at 4:27 pm

Is there also a way to change it back to dynamic/auto? For example at home you set a static and on the go (e.g. starbucks) you’ll need auto.

Leave a Comment

Previous post:

Next post: