Subscribe

Get the Network Administrators tool pack

Subscribe to our newsletter and get 11 free network administrator tools, plus a 30 page user guide so you can get the most out of them.

Click Here to get your free tools

Recent Posts

Search

Archives

Automatically disable wireless when Ethernet is available

Post image for Automatically disable wireless when Ethernet is available

by Steve Wiseman on January 11, 2012 · 69 comments

in Scripts,Tips,Tools


.

Got a question from Enrico,

“Good morning Steve, and Happy New Year!…I would like that when the user has a wired NIC up and running, the wireless NIC is automatically disabled, and as soon as the wired NIC disconnects, the wireless NIC activates.

This prevents the user to have both NICs up and running at the same time and above all prevents wireless access points to collapse for too many unneeded simultaneous connections.”

Awesome question Enrico.

There are other reasons for wanting this too. If you have both connections running, things like file transfers, or anything that needs the extra speed of Ethernet…might end up going through the wireless instead.

For this question, I have created a VB Script that will receive the names of the two network cards in its command line parameters.

For example, if you look at your network connections:

Network Connections

See the descriptions for them? That is what you will use to identify them.

If you wanted to watch the “Local Area Connection” adapter…and then switch the “Wireless Connection” Adapter, you would call the script like this:

Watch Ethernet Example

The program will not display anything, but run in the background looking for the change. It will continue to run until the user logs out.

If the Local Area Connection is no longer connected, it will automatically enable the Wireless connection.

The reverse is true…if Local Area Connection becomes available, it will automatically disable the wireless connection.

The best place to run the script would be from a group policy computer configuration logon script (Not a user configuration) because it will run as local system and have the proper permission to enable and disable network cards.

You can get the script from here:

For 2003, Vista, Windows 7, and 2008:
NetSwitch.dat

For Windows XP:

NetSwitchXP.dat

Just rename to NetSwitch.vbs after downloading.

One more thing…Subscribe to my newsletter and get 11 free network administrator tools, plus a 30 page user guide so you can get the most out of them. Click Here to get your free tools

Related Articles:

{ 19 comments… read them below or add one }

Leave a Comment

Category Links - Windows Forum - Exchange Forum