This is how to add/remove IP address, Default Gateway and DNS and WINS addresses to your NIC using a script.
you can use Netsh.exe -which is available on Windows 2000, Windows XP and Windows Server 2003.
This can be used when you two different places LAN Environment with static and DHCP
Adding ip addresses - Static LAN Environment
===================================
netsh interface ip set address name="Local Area Connection" static
158.223.101.53 255.255.0.0 158.2232.89
netsh interface ip set dns "Local Area Connection" static 158.223.1.1
netsh interface ip set dns "Local Area Connection" static 158.223.1.3
===================================
Removing ip addresses - DHCP Lan Environment
netsh interface ip set address "Local Area Connection" dhcp
netsh interface ip set dns "Local Area Connection" dhcp
===================================
E.Ravi