command to enable\disable network card

  • Thread starter Elton Seng Yan Thung
  • Start date
E

Elton Seng Yan Thung

Dear all,
We have just installed wireless AP in our meeting rooms. The objective
is to allow notebook users to using wireless network during the meeting.
Most of the notebook comes with 2 NIC (wired and wireless ) today. Our
policy is to have a NIC work at the same time only. If the user is on his
desk, he\she should use wired nic only. If in meeting room, the wired NIC
should be disabled. It is to avoid unnecessary routing and roaming problem.
In order to simplify the process for our users, we are trying to create
2 shortcut in their desktop to
1) Enable wired and disable wireless when they are in their desk
2) Enable wireless and disable wired when they are in meeting.
I been searching the net and don't find a command to do so in script or
batch file. I heard netsh command is able to accomplish the task. But I just
not able to find the syntax for the task. For the reason, your advise and
help is needed.

thanks
 
S

Shilpa Sinha [MSFT]

Hi

Hope this helps,

If you want to disable the interface to prevent traffic from being passed
by the network adapter, you can use the Netshell tool to set a different IP
address (such as a private IP address) or default gateway (which in effect,
disables the network adapter). The following example shows the syntax for
this configuration:

netshell interface ip set address interface_name static ip_address
subnet_mask default_gateway metric

For additional information about the Netshell tool, click the article
number below to view the article in the Microsoft Knowledge Base:
242468 - How to Use the Netsh.exe Tool and Command-Line Switches

Reference links:

http://support.microsoft.com/default.aspx?scid=kb;EN-US;242468
http://support.microsoft.com/default.aspx?scid=kb;en-us;262265
For details about Using netsh command:
http://www.microsoft.com/windowsxp/home/using/productdoc/en/default.asp?url=
/WINDOWSXP/home/using/productdoc/en/netsh.asp


Shilpa Sinha
This posting is provided "AS IS" with no warranties, and confers no rights.
 
G

Guest

Why that way, i should be able to use "netsh interface set interface name={IFName} admin=enabled connect=disconnected"? to do that, it sound more natural to me, but it doesn't work, could any body explain that to me.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top