1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

Disabling a NIC using Batch file commands

Discussion in 'Networking' started by easystreet, May 20, 2004.

Thread Status:
Not open for further replies.
Advertisement
  1. easystreet

    easystreet Thread Starter

    Joined:
    Apr 14, 2004
    Messages:
    6
    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?
    :confused:
     
  2. Geoffp

    Geoffp

    Joined:
    May 11, 2004
    Messages:
    9
    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/directory/article.asp?ID=KB;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
     
  3. easystreet

    easystreet Thread Starter

    Joined:
    Apr 14, 2004
    Messages:
    6
    Thanks for the info - will give it a try.
     
As Seen On
As Seen On...

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.

Join over 733,556 other people just like you!

Loading...
Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/230918