I want to directly connect my smartphone to my Windows 10 laptop through WiFi without using a router. Like using a cross-over LAN cable, but with WiFi. In previous Windows versions, you were able to configure this through the GUI, but in Windows 10, you can only create a mobile hotspot which is not exactly the same.
So, how can I create a wireless ad hoc network in Windows 10?
1 Answer
In Windows 10, it is still possible to create a wireless ad hoc network, but not through the GUI. You have to use an elevated CMD or PowerShell.
Before creating it, make sure your WiFi adapter supports the creation of a wireless ad hoc network. Execute the following command:
netsh wlan show driversAssert that the line Hosted network supported: ends with Yes. Otherwise, you have to update your drivers or use different drivers (like using a more specific driver for your adapter model instead of a generic driver).
Creation
Configure your wireless ad hoc network:
netsh wlan set hostednetwork mode=allow ssid=MySSID key=MyPassword keyUsage=temporaryIf you plan to reuse this configuration, omit the
keyUsageparameter (or set it topersistent). Setting it totemporarymakes sure that the password will not be stored permanently.Enable your wireless ad hoc network:
netsh wlan start hostednetwork
You are then ready to go. You can issue netsh wlan show hostednetwork to monitor its status or ipconfig /all to retrieve the IP address of your laptop for the wireless ad hoc network.
Deletion
Disable your wireless ad hoc network:
netsh wlan stop hostednetworkDelete your wireless ad hoc network configuration. Unfortunately, you cannot do that directly. Your SSID will remain in the registry, for example. A workaround is to reset the configuration to its defaults:
Stop the WLAN AutoConfig service:
Stop-Service wlansvcDelete the wireless ad hoc network configuration from the registry:
Remove-Item "HKLM:\SYSTEM\CurrentControlSet\Services\WlanSvc\Parameters\HostedNetworkSettings"Start the WLAN AutoConfig service (it will automatically restore the defaults in the registry):
Start-Service wlansvc