Discussion Locked

How to change IP address, DNS, WINS using batch file

0 helpful
5 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.
Please help on how to this by doing a script for the batch file without restarting winxp pc and manually configure each numbers.

5 replies

by sindhu.arvind

netsh interface ip set address "Local Area Connection" static 192.168.1.10 255.255.255.0 192.168.1.1 1

U can use your Own IP, Subnet Mask & Gateway

First One Is IP, Second Subnet Mask, & Third Gateway.

by y2jay_j

Here is the code to set static ip address. Make a batch file and paste following commands.

This code should work in XP and Vista. Vista users have to run the batch file as an administrator. (Right click the batch file and click "Run as Administrator")
_________________________________________

:: Enter your static ip address, Subnet Mask and Default Gateway
netsh interface ip set address name = "Wireless Network Connection" source = static addr = 192.168.0.12 mask = 255.255.255.0 gateway = 192.168.0.2 gwmetric = 1

:: Enter your Preferred DNS Server
netsh interface ip set dns name="Wireless Network Connection" static 24.92.22.90

:: Enter your Alternate DNS Server, if you dont know remove the following line
netsh interface ip add dns name="Wireless Network Connection" 24.92.22.102 index=2
__________________________________________

To reset these values to automatic settings make anther batch file and paste following commands.

__________________________________________

netsh interface ip set address name="Wireless Network Connection" source=dhcp

netsh interface ip set dns name="Wireless Network Connection" source=dhcp register=primary

netsh interface ip set wins name="Wireless Network Connection" source=dhcp
__________________________________________

- Jay

This discussion is closed to new replies.