Windows network script

Today i have discovered a very usefull script to manage network connection under Windows XP/Vista/7. I know that this is maybe obvoius but I want to share that info.

First is a script for automatically obtaining IP adres:

netsh interface ip set addres name=”Default network connection” source=dhcp
netsh interface ip set dns “Default network connection” source=dhcp
netsh interface ip set wins name=”Default network connection” source=dhcp

Second one is for static IP configuration”

netsh interface ip set address name=”Default network connection” source=static addr=xxx.xxx.xxx.xxx mask=xxx.xxx.xxx.xxx gateway=xxx.xxx.xxx.xxx gwmetric=1
netsh interface ip set dns “Default network connection” static xxx.xxx.xxx.xx

Of course you should replace the xxx.xxx.xxx.xxx with your IP configuration 🙂

Leave a Reply

Your email address will not be published. Required fields are marked *