Sunday, April 4, 2010

Changing network setting by a batch file in windows



You may change network setting (IP, DNS etc) using batch file in Windows XP
.
Lets say, you want a config shown below:



To do so, create a file names as changeIP.bat and write following lines into that:

netsh int ip set address name="Local Area Connection" source=static addr=10.129.163.208 mask=255.255.255.0
netsh int ip set address name="Local Area Connection" source=static gateway=10.129.163.1 gwmetric=0
netsh int ip set dns name="Local Area Connection" source=static addr=202.144.13.50 register=PRIMARY
netsh int ip add dns name="Local Area Connection" addr=202.144.50.4 index=2
netsh int ip set wins name="Local Area Connection" source=static addr=none

Now whenever you execute this bat file, your network setting will be changed as required

No comments:

Post a Comment