Vicente García said:
Hello,
Sorry for my bad English. How could I enable or disable a network interface
from command line?
Many thanks
Vicente
You can use devcon.exe. Its application is not quite
trivial - here is a batch file you could use. Save it as
c:\Windows\NIC.bat. You must obtain the description
of your network adapter from the Control Panel /
Network Connections, then paste it into the second
line of the batch file.
@echo off
set Description=Broadcom NetXtreme Fast Ethernet
if /i "%1"=="enable" goto start
if /i "%1"=="disable" goto start
echo Syntax: NIC enable / disable
goto :eof
:Start
setlocal enabledelayedexpansion
set HWID=x
set count=0
set found=no
devcon hwids "*" > c:\usb.txt
for /F "tokens=*" %%* in (c:\usb.txt) do (
set /a count=!count! + 1
if /i "%%*"=="Name: %Description%" set found=yes& set count=1
if !found!==yes if !count!==4 set HWID=%%*
)
devcon %1 "!HWID!"
endlocal
del c:\usb.txt
You can download devcon.exe from here:
http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q311272