XP: Set or configure network interface to DHCP wtih netsh from command line

Home -> Windows -> Network administration

8040 views

From the computer of: qmchenry (338 recipes)
Created: Jul 18, 2006


Add a comment

Add to:
Add to stumbleuponAdd to del.icio.usDigg itAdd to FURL

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.

Subscribe to the Tech-Recipes Newsletter

You can get tips like this delivered in your email every week!

Enter your Email

We will never, ever sell your email address or spam you.





Related recipes:

  XP: Set or configure static network IP address wtih netsh from command line
  XP & 2000 users that use static ip's in one office & dhcp in another office
  Virtual Server 2005: How To Configure the Virtual DHCP Server
  Renew DHCP client lease in Windows
  How to Reset Internet Protocol (TCP/IP) in Windows XP
  NT/2000/XP: Add a temporary route to the Windows routing table
  Repair Network Connection in Windows XP
  NT/2000/XP: Display or view the Windows routing table
  Run Network Diagnostics on Windows to Debug Your Connections
  Home Network Troubleshooting Tips

 

Sponsored links

 

Login

Nickname

Password

Don't have an account yet? You can create one. As a registered user you have some advantages like theme manager, comments configuration and post comments with your name.