Results 1 to 3 of 3

Thread: Batch file to disable or enable network adapter

  1. #1
    Join Date
    May 2010
    Posts
    4

    Batch file to disable or enable network adapter

    Help!!!!!

    Is there anyone know how to write a batch file to enable / disable local area connection just by 1 click on the batch file??

    Thank you so much...

  2. #2
    Join Date
    Jun 2006
    Posts
    623

    Re: Batch file to disable or enable network adapter

    You can download a utility from MS called "devcon.exe" from here put the below command to disable and enable my network connection that will list of all hardware ID's for devices:

    devcon hwids * > out.txt

    For the ethernet cards entry, I got the below entry:

    Hardware ID's:
    PCI\VEN_1317&DEV_0985&SUBSYS_05741317&REV_11
    PCI\VEN_1317&DEV_0985&SUBSYS_05741317

    The hardware id was "PCI\VEN_1317"

    After that from the command prompt just disable the network connection with the below command:

    devcon disable PCI\VEN_1317

  3. #3
    Join Date
    Jul 2009
    Posts
    1,118

    Re: Batch file to disable or enable network adapter

    It is possible to do that. For that first you will need generate a script file for the same. The commands you will need to add are :

    netsh interface set interface "Local Area Connection " ENABLE
    netsh interface set interface "Local Area Connection " DISABLE

    Copy this command in notepad and save it as bat file. You can create separate script for both. Running the same by double clicking will disable the connection. Try this.

Similar Threads

  1. How enable network adapter in script?
    By maketu in forum XP Hardware
    Replies: 3
    Last Post: 06-05-2012, 07:35 PM
  2. Replies: 4
    Last Post: 28-07-2010, 10:30 PM
  3. Can not disable network adapter
    By Joko in forum Networking & Security
    Replies: 7
    Last Post: 18-03-2009, 11:48 PM
  4. Enable/Disable Network connection at once
    By Fabio Rosa in forum Windows Server Help
    Replies: 6
    Last Post: 17-02-2009, 07:18 PM
  5. How do I enable DHCP on my network adapter?
    By Nitnam in forum Windows Vista Network
    Replies: 2
    Last Post: 23-02-2008, 03:29 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,713,885,997.97715 seconds with 17 queries