Two wi-fi adapters?

10

0

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

RogUE

Posted 2015-02-15T09:06:45.897

Reputation: 2 431

1

Possible duplicate question: http://stackoverflow.com/questions/20810767/netsh-set-multiple-hostednetwork

– Chirag Bhatia - chirag64 – 2015-08-16T08:24:55.790

Answers

3

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.

vlk

Posted 2015-02-15T09:06:45.897

Reputation: 131

2

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.

Spiff

Posted 2015-02-15T09:06:45.897

Reputation: 84 656

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 – 2015-08-21T02:16:30.983

Will 'netsh wlan show interface' show all the interfaces in the PC? – RogUE – 2015-08-21T02:26:26.277

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 – 2015-08-21T02:27:46.827

I can't test it because I do not have a pc with multiple interfaces. – RogUE – 2015-08-21T02:32:38.520

@RogUE I can't test it either, for the same reason. I'm just going off of my understanding of the documentation. – Spiff – 2015-08-21T02:33:51.527

I tried to use this technique in Windows 7 but couldn't find an interface parameter. – Kolban – 2016-07-19T23:43:38.077

3@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 – 2016-10-27T16:40:42.187