XP: Set or configure network interface to DHCP wtih netsh from command line
My predisposition to command line solutions to problems stems from my UNIXness and, well, I’ll admit that it’s fun to intimidate GUI users. However, there are times that command line solutions are the best fit for a problem. For example, if you find yourself frequently switching between a static IP address and DHCP for a network interface as happens with laptops sometimes, wouldn’t it be nice to have a command that could fit in a batch file? The netsh command in XP SP2 makes this possible. This recipe shows the command to make an interface use DHCP.
To make the interface Local Area Network use DHCP instead of a static address, use the command (all on one line):
netsh int ip set address name="Local Area Connection" source=dhcp
Other interface names can be substituted as needed.





