Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

enable/disable LAN from command prompt

Status
Not open for further replies.

RetrogradePAK

IS-IT--Management
Joined
Apr 29, 2002
Messages
170
Location
CA
i wanna know how can i enable or disable my LAN interface "Local Area Connection" form command prompt without using any 3rd party tools
 
If your ethernet adapter is set for DHCP you can just use ipconfig /release and it wont have an IP or the ability to route. There is a nifty command in 2k3 server but it doesnt work the same in XP appearantly. Alternatively you can use this


Use the command:
devcon disable "devicename"

Make sure you save devcon inside system32.
 
That's what I was thinking - use netsh to assign a bogus gateway (127.0.0.1). This does not really 'disable' the adapter however, if that's what you're really after for some reason.
 
If the computer is set to dynamic ip addressing run from command prompt
ipconfig /release

followed by
net stop dhcp

This would release the IP address and then stopping dhcp would or should stop the renewal of the IP address and the pc would not get an IP address

to start it again run
net start dhcp
followed by
ipconfig /renew
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top