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
source share