Create a batch file, put the below script in and run it as administrator.
@echo "Setting static IP."
@netsh interface ip set address "Ethernet0" static 192.168.1.100 255.255.255.0 192.168.1.1
@echo "Setting DNS."
@netsh interface ip set dns "Ethernet0" static 8.8.8.8
@echo "Restarting network interface."
@netsh interface set interface name="Ethernet0" admin=disabled
@netsh interface set interface name="Ethernet0" admin=enabled
netsh interface ip set address "Ethernet0" dhcp
netsh interface ip set dns "Ethernet0" dhcp
@echo "Restarting adapter."
@netsh interface set interface name="Ethernet0" admin=disabled
@netsh interface set interface name="Ethernet0" admin=enabled
NB: You need to change the Ethernet0 to your connection name and IP addresses as required.