Disconnecting an Ethernet connection to the command line?

I saw a lot of messages about disabling command line wireless, but not about disabling ethernet.

Can this be done (on Windows 7, 32 and 64 bit)?

+4
source share
3 answers

In windows 7 you can use

wmic path win32_networkadapter where NetConnectionID="Local Area Connection" call disable wmic path win32_networkadapter where NetConnectionID="Local Area Connection" call enable 

Even in more details (Start elevated command line):

Get NIC List and Index Number

 wmic nic get name, index 

Enable network adapter with index number (for example: 7)

 wmic path win32_networkadapter where index=7 call enable 

Disconnect the network adapter with the index number (for example: 7)

 wmic path win32_networkadapter where index=7 call disable 

Here is the command in Windows XP:

 netsh interface set interface name="Local Area Connection" admin=disabled 

If the network name is not "Local Area Connection", replace it with the one you are using.

Link: http://answers.microsoft.com/en-us/windows/forum/windows_7-hardware/enabledisable-network-interface-via-command-line/17a21634-c5dd-4038-bc0a-d739209f5081

+10
source

To temporarily disable it, you can use this:

 ipconfig /release local*3 

if your connection was called "Local Area Connection 3"

0
source

if you want to disconnect the network automatically when shutting down for Windows 7 64bit

use notepad to disable the command line from the Raptor answer above and save it as a .bat file

Launch gpedit.msc and go to ... computer configuration, Windows settings, scripts, shutdown

double click "shutdown", click "show files", paste the .bat file into the popup folder. Click the Add button to add the .bat file.

:)

-5
source

All Articles