XP: Set or Configure Network Interface to DHCP with netsh from Command Line

Posted July 18, 2006 by Quinn McHenry in Windows networking

Last Updated on

My predisposition to command line solutions for problems stems from my vast experience with UNIX. (I will admit that it is 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, it would be nice to have a command that could fit in a batch file. The netsh command in XP SP2 makes this possible. This tech-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 following command (all on one line):

netsh int ip set address name="Local Area Connection" source=dhcp

Other interface names can be substituted as needed.

 

About Quinn McHenry

Quinn was one of the original co-founders of Tech-Recipes. He is currently crafting iOS applications as a senior developer at Small Planet Digital in Brooklyn, New York.
View more articles by Quinn McHenry

The Conversation

Follow the reactions below and share your own thoughts.

Leave a Reply