Advertisement

There's no such thing as a stupid question, but they're the easiest to answer.
Login
Search

Advertisement

Networking Networking
Search Search
Search for:
Tech Support Guy > > >

Disabling a NIC using Batch file commands


(!)

easystreet's Avatar
easystreet easystreet is offline
Junior Member with 6 posts.
THREAD STARTER
 
Join Date: Apr 2004
20-May-2004, 09:54 AM #1
Disabling a NIC using Batch file commands
I have a Win2K system with 2 NICs in it. I can go to MyNetworkPlaces>Properties and right-click on one of the NICs and select Disable.

Does anyone know how to duplicate these actions via one or more Batch File commands?
Geoffp's Avatar
Geoffp Geoffp is offline
Junior Member with 9 posts.
 
Join Date: May 2004
20-May-2004, 01:09 PM #2
Excellent question. I was curious myself as I've never heard of a way to do it, I figured netsh would have something, but nothing worked, so I snooped around a bit more and found a usenet post suggesting the use of a utility from MS "devcon.exe"

You can download the devcon utility here:

http://support.microsoft.com/directo...;EN-US;Q311272

Since I've never used it before, there may be an easier way, you'll need to play with the program a little, but here's how I was able to disable and enable my network connection:

devcon hwids * > out.txt

The above command outputs a list of all hardware ID's for devices on the local computer. It was quite a long list on my computer which is why I redirected the output to out.txt. Inside out.txt I searched for a my ethernet cards entry.

PCI\VEN_1317&DEV_0985&SUBSYS_05741317&REV_11\3&61AAA01&0&58
Name: Linksys LNE100TX Fast Ethernet Adapter (LNE100TX v4)
Hardware ID's:
PCI\VEN_1317&DEV_0985&SUBSYS_05741317&REV_11
PCI\VEN_1317&DEV_0985&SUBSYS_05741317
etc. etc. a bunch of other mumbo jumbo

The Hardware ID was just the first bit before the &. "PCI\VEN_1317"

Then from the command prompt I was able to disable the network connection with this command:

devcon disable PCI\VEN_1317

:-)

-Geoffp
easystreet's Avatar
easystreet easystreet is offline
Junior Member with 6 posts.
THREAD STARTER
 
Join Date: Apr 2004
20-May-2004, 01:34 PM #3
Thanks for the info - will give it a try.
As Seen On

BBC, Reader's Digest, PC Magazine, Today Show, Money Magazine
WELCOME TO TECH SUPPORT GUY!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.


(clock)
THIS THREAD HAS EXPIRED.
Are you having the same problem? We have volunteers ready to answer your question, but first you'll have to join for free. Need help getting started? Check out our Welcome Guide.

Search Tech Support Guy

Find the solution to your
computer problem!




Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools


WELCOME
You Are Using: Server ID
Trusted Website Back to the Top ↑