Suppose that I have a laptop with built-in Wi-Fi adapter, then I connect another Wi-Fi usb adapter to it(say TP Link TL WN 721N) and installed its driver.
If I use the command netsh wlan set hostednetwork mode=allow ssid=abc key=password to create a Wi-Fi hotspot (Assume that both the adapters support hosted networks), which adapter will be used to create the hotspot, the built-in one or the TP link(in this case)?


Wireless network adapter for hostednetwork is selected by Windows (generally Windows always chose the wireless adapter which we don't want).

Seems only way is to temporary disable all other wireless adapters during enabling hostednetwork.

I automated this with commandline script:

netsh interface set interface name="wifi internet" admin=disabled
netsh wlan set hostednetwork mode=allow ssid=my_wifi_ap key=12345678
netsh wlan start hostednetwork
netsh interface set interface name="wifi internet" admin=enabled

Where name="wifi internet" is name of wireless adapter to temporary disable

This script is necessary to run as administrator, because enabling and disabling interfaces can do only administrator.


netsh wlan commands take an [interface=]interfaceName parameter that becomes a required parameter when you have more than one WLAN interface. You can only leave it off when you only have one WLAN interface.

Update: You asked for more info on using it. Here's an example from the online documentation of netsh wlan for Windows Server 2008:

netsh wlan connect ssid="Wireless Net" name=Profile2 interface="Wireless Network Connection"

I think you should be able to get the WLAN interface names with:

netsh wlan show interface

Disclaimer: I've never dealt with multiple WLAN adapters on a Windows Server 2008 box before, so I can't vouch that it works. So take this with a grain of salt, as it's just my understanding of how it should work, based upon my reading of the documentation.