AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Show Network Adapters

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions
View previous topic :: View next topic  
Author Message
thinkstorm



Joined: 17 Aug 2004
Posts: 18

PostPosted: Tue Aug 17, 2004 7:20 pm    Post subject: Show Network Adapters Reply with quote

Very easy
TC

Quote:

#i:: Run, control ncpa.cpl
Back to top
View user's profile Send private message
beardboy



Joined: 02 Mar 2004
Posts: 444
Location: SLC, Utah

PostPosted: Thu Aug 19, 2004 2:11 am    Post subject: Reply with quote

Does anyone know how to enable / disable the adapters without bringing this screen up and right clicking on them and selecting enable / disable?

thanks,
beardboy
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger
Chris
Site Admin


Joined: 02 Mar 2004
Posts: 10465

PostPosted: Thu Aug 19, 2004 9:01 am    Post subject: Reply with quote

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.com/groups?q=enable+disable+network+adapter+command&hl=en&lr=&ie=UTF-8&selm=atibgn%241485pi%241%40ID-156657.news.dfncis.de&rnum=2

netsh 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.microsoft.com/default.aspx?scid=kb;en-us;262265

In 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.microsoft.com/default.aspx?scid=kb;en-us;242468

How to Use the NETSH Command to Change from Static IP Address to DHCP in Windows 2000 - http://support.microsoft.com/default.aspx?scid=kb;en-us;257748

Shell.Application/VBScript
From: Michael Harris (mikhar@mvps.org)
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.com/groups?threadm=OcFYOQD1BHA.2848%40tkmsftngp05

Devcon.exe maybe?
Take a look at this thread:
From: Jon (jonc@stargatefilms.com)
Subject: Enable/disable network adapter
Newsgroups: microsoft.public.win2000.cmdprompt.admin
Date: 2002-02-28 11:43:59 PST
http://groups.google.com/groups?hl=en&th=5c30bf627c5883ae&rnum=12


For more information about devcon.exe (W2K/XP DDK)
Message-ID: <ebVUeG2lBHA.1964@tkmsftngp07>
From: Stephane Barizien (NOSPsbaAM@ocegr.fr)
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.com/groups?hl=en&selm=ebVUeG2lBHA.1964%40tkmsftngp07

- and -
this MS Knowledge Base article:
http://support.microsoft.com/default.aspx?scid=KB;EN-US;q311272
Back to top
View user's profile Send private message Send e-mail
beardboy



Joined: 02 Mar 2004
Posts: 444
Location: SLC, Utah

PostPosted: Thu Aug 19, 2004 1:13 pm    Post subject: Reply with quote

Thanks for the info Chris.

thanks,
beardboy
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group