12

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)?

1

2 Answers 2

5

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.

1

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.

7
  • Would you elaborate a little on the usage of the parrameter, as there is none given in the help for that command? And, how to get the name of the interface?
    – RogUE
    Aug 21, 2015 at 2:16
  • Will 'netsh wlan show interface' show all the interfaces in the PC?
    – RogUE
    Aug 21, 2015 at 2:26
  • Without specifying which interface to show, it should show all the interfaces of that type. Since this is in the wlan context, it should show all the WLAN interfaces.
    – Spiff
    Aug 21, 2015 at 2:27
  • I can't test it because I do not have a pc with multiple interfaces.
    – RogUE
    Aug 21, 2015 at 2:32
  • 4
    @RogUE asked about setting up the hosted network, not how to connect to one. The parameter interface is not allowed in the command wlan set hostednetwork. It produces a 'interface' is not a valid argument for this command. error.
    – Odys
    Oct 27, 2016 at 16:40

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .