Qondio
Front
Intel
IntelMart
Shares
My Qondio
Account
capo > Intel > Changing IP Address with Batch files

qondio.com/cG9r PRINT EMAIL

Changing IP Address with Batch files

Have you ever had to constantly be changing your IP address of either your Wireless or LAN connection because of frequent location changes? If you do this because of your work or for school, then you know that using Window’s graphical interface to change your network settings is quite tedious and irritating. There is a quick way to change the IP of your preferred interface simply by opening a file, in this case a .bat file.


First we need to create the .bat file. Open notepad and enter these four lines:

netsh interface ip set address name="INTERFACE" source=static addr=IP ADDRESS mask=MASK
netsh interface ip set address name="INTERFACE " gateway=GATEWAY gwmetric=0
netsh interface ip set dns name=" INTERFACE " source=static addr=DNS
netsh interface ip add dns name = " INTERFACE " addr = DNS2


but making the following substitutions:

INTERFACE for the name of the interface your using to connect to the network, for example, Wireless Network Connection or Local Area Connection.
IP ADDRESS for your IP address, for example, 192.168.1.10
MASK for the network mask, for example, 255.255.255.0.
GATEWAY for the network gateway, for example, 192.168.1.1
DNS for the network DNS server, for example, 192.168.1.254
DNS2 for the second network DNS server, for example, 192.168.1.253


Note that the last line is optional and used only if the network has two DNS servers.


If this information is provided automatically to you (by DHCP), then you only need to enter the following two lines instead:

netsh interface ip set address name="INTERFACE " dhcp
netsh interface ip set dns name="INTERFACE " dhcp


but making the following substitution:

INTERFACE for the name of the interface your using to connect to the network, for example, Wireless Network Connection or Local Area Connection.


After you enter the corresponding lines you must save the file as .bat by doing the following:

1. Click on File - Save As.
2. In Location select where you would like to save your file.
3. In File Name enter the name for your batch file with the .bat extension, for example, wireless_dhcp.bat.
4. In Save As Type select “All Files”.
5. Click Save.


Now that you’ve created your batch file all you need to do is open it in order to change your network settings. You should create a batch file for every network/connection that you require as well as one for Wireless DHCP.

Contributed by capo on February 11, 2008, at 1:33 PM UTC.

Reactions

No reactions yet.

Rate This Intel

Please login or sign up to rate this intel.

Comments

Please login or sign up to add a comment.

Share

Copyright Notice

The copyright for this content entitled "Changing IP Address with Batch files" has been specified by the contributor as:

All Rights Reserved

This content may not be copied, distributed or adapted by anyone under any circumstances.

Login Here with
Any Email Address
Any Password
No account? Sign up.

Intel Contributor
This intel was contributed by capo


Qondio Archive
May, 2012
123456
78910111213
14151617181920
21222324252627
28293031


2008
January, February, March, April, May, June, July, August, September, October, November, December
2009
January, February, March, April, May, June, July, August, September, October, November, December
2010
January, February, March, April, May, June, July, August, September, October, November, December
2011
January, February, March, April, May, June, July, August, September, October, November, December
2012
January, February, March, April, May

Sign Up
Not a member yet? Qondio is a powerful network for making it online. If you have a website to promote, we can help. Sign up and get in on the action.

About Qondio
Welcome to Qondio! Discover the awesome power this network can deliver by going to our About page. Or you could skip straight to the Sign Up form.

ABOUT
SUCCESS GUIDE
FEATURES
FAQ
ADVERTISE
CONTACT
USAGE POLICY
PRIVACY POLICY


TWITTER
FACEBOOK