you may want to use netsh. this may help. quoted from www.chicagotech.net.
How to switch between static ip and DHCP
To switch the specified adapter from a static address to DHCP, type the following command:
netsh interface ip set address "chicagotechnet" dhcp
To change to a static address, type the following command:
netsh interface ip set address "chicagotechnet" static ipaddr subnetmask gateway metric
How to switch between static ip and DHCP
To switch the specified adapter from a static address to DHCP, type the following command:
netsh interface ip set address "chicagotechnet" dhcp
To change to a static address, type the following command:
netsh interface ip set address "chicagotechnet" static ipaddr subnetmask gateway metric