3

I am following this tutorial to set up a Wifi hotspot from my Windows 10 PC.

When I run netsh set hostednetwork mode=allow ssid=Your_SSID key=Your_Passphrase, I think it uses the adapter called Wi-Fi. I have a USB Wifi dongle that I want to use for my hotspot, which is listed as Wi-Fi 2.

Is there a way I can change the above command to use the USB dongle instead of my laptop's built-in Wifi adapter?

3

The key here is to disable the adapters that you don't want the hostednetwork to start on. If you only have one active adapter and run:

netsh wlan set hostednetwork mode=allow ssid=Your_SSID key=Your_Passphrase
netsh wlan start hostednetwork

then it will auto assign itself to that adapter.

Since you have 2 wireless adapters, wifi1 and wifi2, and you want it to run on wifi2, you can disable wifi1, run script, then enable wifi1 again. This forces hostednetwork on wifi2.

Code:

netsh interface set interface name="Wi-Fi1" admin=disabled
netsh wlan set hostednetwork mode=allow ssid=Your_SSID key=Your_Passphrase
netsh wlan start hostednetwork
netsh interface set interface name="Wi-Fi1" admin=enabled

Note: May need to run this batch as administrator.

  • But what if you want to have both enabled because you want to create a brdige between them o because you want to use them for different things? – skan Feb 13 '18 at 17:53
  • @skan They are both enabled. You just turn one off for a brief second to apply your hostednetwork to the desired interface. Note that you cannot apply a hostednetwork (virtual AP) to a bridged interface or bridge an adapter using the AP. "bridging is prohibited between the AP adapter and any other adapters in the system" msdn.microsoft.com/en-us/library/windows/desktop/… – Narzard Feb 13 '18 at 19:27
  • I have two adapters, I want to use one a client to connect my laptop to my wifi and use the other as an AP to repeat the signal. – skan Feb 14 '18 at 17:52
  • what if you want to run the commands on startup? – jerinho Jun 13 at 5:40
  • 1
    @jerinho then save the above as a .bat file, open Task Scheduler and setup as normal with the trigger being set to the "on startup" option. – Narzard Jun 13 at 13:25
0

For those of you trying to find the interface name you can issue the following command and follow the exising answer.

netsh wlan show drivers

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.