I pulled up a few things from Google newsgroups (not everyone knows how useful it can be to search the newsgroups this way):
http://groups.google... ... .de&rnum=2netsh interface set interface name="Local Area Connection" admin=DISABLED
or
netsh interface set interface "Local Area Connection" DISABLED
But you might get an error message (I did) as described in the KB Article: Error Message When You Use Netsh.exe to Enable or Disable a Network Adapter --
http://support.micro... ... -us;262265In which case do as the article suggests and change the IP address settings. I used this command which seem quite effective in disabling the interface (its one long line):-
netsh interface ip set address "Local Area Connection" static 10.0.0.1 255.0.0.0 10.0.0.1 1
If the interface was using DHCP, it can be enabled using:-
netsh interface ip set address "Local Area Connection" dhcp
Other references:
How to Use the Netsh.exe Tool and Command-Line Switches --
http://support.micro... ... -us;242468How to Use the NETSH Command to Change from Static IP Address to DHCP in Windows 2000 -
http://support.micro... ... -us;257748Shell.Application/VBScript
From: Michael Harris (
[email protected])
Subject: Re: How to disable-Enable Local area Connection via script
Newsgroups: microsoft.public.scripting.vbscript
Date: 2002-03-25 11:36:10 PST
http://groups.google... ... kmsftngp05Devcon.exe maybe?
Take a look at this thread:
From: Jon (
[email protected])
Subject: Enable/disable network adapter
Newsgroups: microsoft.public.win2000.cmdprompt.admin
Date: 2002-02-28 11:43:59 PST
http://groups.google... ... ae&rnum=12For more information about devcon.exe (W2K/XP DDK)
Message-ID:
From: Stephane Barizien ([email protected])
Subject: Re: Command-line equivalent to Device Manager's "Scan for hardware
changes"
Newsgroups: microsoft.public.win2000.cmdprompt.admin,
microsoft.public.win32.programmer.wmi
Date: 2002-01-07 02:00:08 PST
http://groups.google... ... kmsftngp07
- and -
this MS Knowledge Base article:
http://support.micro... ... US;q311272