I am trying to write some short scripts with netsh. One for changing the adapter to static addressing, and the other for replacing the same adapter with DHCP.
I can get a set of adapters with all the correct static address settings using
netsh interface ip set address "Local Area Connection" static 10.61.1.253 255.255.255.0 10.61.1.1 1
It works great. When I run the following command (a script) to switch to DHCP, I get an error.
netsh interface ip set address "Local Area Connection" dhcp
DHCP is already enabled on this interface.
This is on a Windows 7 computer.
Any idea what the problem is?
source share