Well, there is also the Nirsoft tool, working from wIndows 2000 up to 10, I thought we were talking "built-in" (and command line):
http://www.nirsoft.n...interfaces.html
Like most Nirsoft utilities it is possible to parse the output by saving to an empty-name file and piping it, example:
NetworkInterfacesView.exe /stab "" | Find "" /v
and it has a /enable and /disable switch alright (and it has both 32 and 64 bit version).
It correctly filters the "real" NIC's but the "generic" issue when more than one adapter is present remains, the Status column has values "Operational" and "Hardware Disconnected", but nothing prevents someone to have two or more NIC's "Operational", so one needs anyway to manually find the "right" interface (by means of the GUI) and then use its "localized" connection name, the manufacturer's "device name" or - advised - its GUID in the enable/disable command.
Example:
@ECHO OFF
SETLOCAL ENABLEEXTENSIONS ENABLEDELAYEDEXPANSION
SET /A Counter=1
::Get Column Names
FOR /F "tokens=* delims=," %%A IN ('NetworkInterfacesView.exe /scomma "" ^| FIND /v ""') DO SET Columns=%%A&GOTO :Get_Index
:GET_Index
CALL :Col_names %Columns: =_%
FOR /F "skip=1 tokens=* delims=," %%? IN ('NetworkInterfacesView.exe /scomma "" ^| FIND /v ""') DO SET Columns=%%?&CALL :prettify
GOTO :EOF
:Col_names
::Device_Name
::Interface_GUID
::MTU
::Lease_Obtained_Time
::Lease_Terminates_Time
::T1_Time
::T2_Time
::Registry_Time
::Status
::MAC_Address
::Connection_Name
::IP_Address
::Subnet_Mask
::Default_Gateway
::Name_Servers
::DHCP_Enabled
::DHCP_Server
::Instance_ID
IF %1.==. SET /A Counter=1&GOTO :EOF
SET %1=Col_x%Counter%
SET Col_x%Counter%=%1
SET /A Counter+=1
SHIFT
GOTO :Col_names
GOTO :EOF
:prettify
SET Columns=%Columns:&=_AND_%
SET Columns=%Columns: =_%
SET Columns=%Columns:,,=,N/A,%
SET Columns=%Columns:,,=,N/A,%
FOR /L %%A IN (1,1,18) DO SET Col_x%%A=N/A
CALL :Number_Cols %Columns%
IF !%IP_Address%!==N/A SET %IP_Address%=xxx.xxx.xxx.xxx
SET %IP_Address%= !%IP_Address%!
SET %IP_Address%=!%IP_Address%:~-15,15!
IF !%Status%!==Operational SET %Status%=Y
IF !%Status%!==Hardware_Disconnected SET %Status%=N
IF !%MAC_Address%!==N/A SET %MAC_Address%=XX-XX-XX-XX-XX-XX
SET Line=!%Status%! !%MAC_Address%! !%Interface_GUID%! !%Device_Name%:_= !
ECHO %Line:~0,79%
GOTO :EOF
:Number_Cols
IF %1.==. SET /A Counter=1&GOTO :EOF
SET Col_x%Counter%=%1
SET /A Counter+=1
SHIFT
GOTO :Number_Cols
Wonko