enable or disable a network interface

  • Thread starter Thread starter Vicente García
  • Start date Start date
V

Vicente García

Hello,

Sorry for my bad English. How could I enable or disable a network interface
from command line?

Many thanks
Vicente
 
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
 
Many thanks,

I will explain in English...Someone tells me about devcon but I thought that
I couldn't use it because if I have two interfaces as the following:

PCI\VEN_104C&DEV_8029&SUBSYS_05611014&REV_01\4&AD1B67F&0&01F0
Name: Controladora de host Texas Instruments OHCI Compliant IEEE 1394
Driver is running.
PCI\VEN_104C&DEV_AC44&SUBSYS_05601014&REV_03\4&AD1B67F&0&00F0
Name: Controladora CardBus Texas Instruments PCI-4510
Driver is running.

and if I type:

devcon disable PCI\VEN_104C&DEV_8029&SUBSYS_05611014&REV_01\4&AD1B67F&0&01F0

the tool disble the two interfaces...because I think that devcon only takes
the first part, PCI\VEN_104C&DEV_8029&SUBSYS_05611014&REV_01\
and then devcon disables the two interfaces, instead of the one that I want.

Thanks in advance for the help
Vicente
 
You need to do this when replying to this note:

1. State the name of your network adapter as you see it in
the Control Panel. I assume it is one of these - but which one?
Controladora de host Texas Instruments OHCI Compliant IEEE 1394
Controladora CardBus Texas Instruments PCI-4510

2. Run this command from a Command Prompt:
devcon hwids "*" > c:\usb.txt
Now zip up c:\usb.txt and attach it to your reply.
 
Vicente García said:
I did it and the output was:

PCI\VEN_104C&DEV_8029&SUBSYS_05611014&REV_01\4&AD1B67F&0&01F0
Name: Controladora de host Texas Instruments OHCI Compliant IEEE 1394
Hardware ID's:
PCI\VEN_104C&DEV_8029&SUBSYS_05611014&REV_01
PCI\VEN_104C&DEV_8029&SUBSYS_05611014
PCI\VEN_104C&DEV_8029&CC_0C0010
PCI\VEN_104C&DEV_8029&CC_0C00
Compatible ID's:
PCI\VEN_104C&DEV_8029&REV_01
PCI\VEN_104C&DEV_8029
PCI\VEN_104C&CC_0C0010
PCI\VEN_104C&CC_0C00
PCI\VEN_104C
PCI\CC_0C0010
PCI\CC_0C00
PCI\VEN_104C&DEV_AC44&SUBSYS_05601014&REV_03\4&AD1B67F&0&00F0
Name: Controladora CardBus Texas Instruments PCI-4510
Hardware ID's:
PCI\VEN_104C&DEV_AC44&SUBSYS_05601014&REV_03
PCI\VEN_104C&DEV_AC44&SUBSYS_05601014
PCI\VEN_104C&DEV_AC44&CC_060700
PCI\VEN_104C&DEV_AC44&CC_0607
Compatible ID's:
PCI\VEN_104C&DEV_AC44&REV_03
PCI\VEN_104C&DEV_AC44
PCI\VEN_104C&CC_060700
PCI\VEN_104C&CC_0607
PCI\VEN_104C
PCI\CC_060700
PCI\CC_0607

The name is Controladora de host Texas Instruments OHCI Compliant IEEE 1394.
I know it isn't a network adapter but I think that never mind to try...
I've executed devcon disable PCI\CC_0C00 and then it works perfectly only
with one interface and I've executed devcon disable PCI\CC_0607 and it works
too with the other interface. Is this what I should do?

Many Thanks
Vicente

If it works fine with your commands then there is no need
to investigate any further. Problem solved!
 
Thanks for the help :)
Problem solved!
Vicente

Pegasus (MVP) said:
If it works fine with your commands then there is no need
to investigate any further. Problem solved!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top