5

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?

2 Answers 2

5

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. ( If you do not know the names of your network adapters, you can get a list by entering netsh wlan show drivers at the command prompt. Be sure to put the adapter name in quotes in the following commands if there is a space in the names.)

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.

5
  • 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, 2018 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, 2018 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, 2018 at 17:52
  • what if you want to run the commands on startup? Jun 13, 2019 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, 2019 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

You must log in to answer this question.

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