Creating a hotspot in the Windows operating system is a task that often arises for users when they urgently need to provide internet access to a mobile device or another computer. Unlike the standard settings through the graphical interface, using command line gives the user complete control over network settings, allowing them to configure hidden features and troubleshoot errors that cannot be corrected using conventional methods.
This method is especially useful for system administrators and advanced users who need to deploy a temporary network with specific security parameters or channel frequency. Using the built-in utility netsh, you can turn your laptop into a full-fledged router without installing third-party software, which reduces the risk of system infection and saves processor resources.
In this article, we'll walk you through the setup process in detail, address potential errors, and provide solutions to common issues. You'll learn not only how to launch a network, but also how to manage connected clients and automate the startup process.
System preparation and support verification
Before entering commands, make sure your hardware and drivers support hosted network mode. Modern wireless adapters typically have this feature, but in rare cases, manufacturers may block it at the driver level. To check, enter the appropriate command in the console and analyze the system output.
Open the command prompt as an administrator, as standard user rights will not allow you to make changes to network settings. Enter the command netsh wlan show drivers and look for the line "Hosted network supported." If it says "Yes," you can continue.
⚠️ Note: If your driver does not support hosted network mode, update it from the manufacturer's official website or use the built-in Windows 10/11 "Mobile Hotspot" tools, which operate at a different system level.
It's also worth checking whether the wireless connection is blocked by physical switches or power-saving software. Sometimes the Wi-Fi function is disabled to save battery power, making it impossible to create a hotspot until the adapter is turned on.
Creating and launching a virtual network
The main setup step involves creating a network profile with the specified SSID (network name) and security key. The command must be entered precisely, without any extra spaces, as a syntax error will result in the operation being rejected.
netsh wlan set hostednetwork mode=allow ssid=MyNetwork key=Password123
In this design the parameter mode=allow allows launch, ssid specifies the visible name of the network, and key Sets a password of at least 8 characters. Once successfully completed, you'll see a message stating the network has been created, but it's not yet active.
To start the Internet distribution process, use the command:
netsh wlan start hostednetwork
If everything went well, the system will report that the hosted network has started. Your device is now broadcasting a signal, but the internet connection is not yet available. To stop sharing, use the command netsh wlan stop hostednetwork, and to completely delete the profile - netsh wlan delete hostednetwork.
☑️ Launching an access point
Setting up Internet access sharing (NAT)
The most common issue after network launch is the inability of connected devices to access the global network. This occurs because the virtual adapter has been created but is not authorized to forward traffic through the physical adapter connected to the ISP. Packet forwarding (NAT) must be configured.
Go to the Network Control Panel, select your primary connection (the one you use to browse the internet), click "Properties," and then go to the "Sharing" tab. Here, check "Allow other network users to connect through my internet connection" and select the virtual connection you created from the list (usually called "Wireless Network Connection" with a number).
| Parameter | Meaning / Action | Description |
|---|---|---|
| SSID | Any in Latin | The network name that clients see |
| Security key | Minimum 8 characters | WPA2 connection password |
| Frequency range | 2.4 GHz / 5 GHz | Depends on the adapter and the channel command |
| Maximum clients | Up to 100 (default) | Limited by adapter power |
It is important to understand that after enabling public access, the IP address of the virtual adapter will change to 192.168.137.1This is standard system behavior for setting up a gateway. If the address hasn't changed, try reconnecting the virtual network with the command stop And start.
Why doesn't the Internet work after setup?
Most often, the problem stems from an IP address conflict. Try manually entering the DNS servers (8.8.8.8 and 8.8.4.4) in the TCP/IP settings of the virtual adapter.
Connection diagnostics and management
The created network is managed through a set of diagnostic commands. These allow you to view the network status, the number of connected users, and detailed adapter operating parameters. Regular monitoring helps identify the causes of unstable connections.
To see the current status of a hosted network, including its name, mode, and number of clients, enter:
netsh wlan show hostednetwork
At the bottom of the report, you'll see a list of clients (Client Count) and their MAC addresses. This is useful for monitoring: if you see an unfamiliar device, it's best to change the password and restart the network. This command also displays the authentication and encryption type.
For more in-depth diagnostics, standard tools can be used. ping And ipconfigCheck if the connected phone is receiving an IP address from the correct subnet. If the address starts with 169.254.x.x, this means that the Windows DHCP server is not working correctly, and devices cannot obtain settings automatically.
Automating the launch process
Constantly entering commands manually can be tedious, especially if the hotspot needs to be brought up several times a day. Windows allows you to automate this process using batch files (.bat) and Task Scheduler, turning your laptop into a permanent hotspot.
Create a text file, paste the startup commands into it (with administrator privileges), and save it with the .bat extension. However, simply running this file isn't enough, as it requires elevated privileges. You need to create a task in Task Scheduler with the "At logon" trigger and the "Run with highest privileges" option.
An alternative method is to create a shortcut for the launch command and configure its properties. In the shortcut's advanced settings, you can specify that it run as administrator, but in modern versions of Windows, this may still require UAC confirmation. Therefore, Task Scheduler remains the most reliable solution for background running.
⚠️ Important: When starting automatically, ensure that the network adapter doesn't go into sleep mode. In Device Manager, under the Wi-Fi module properties, uncheck "Allow the computer to turn off this device to save power."
Solutions to common errors
Despite the simplicity of the syntax, users often encounter errors when starting a hosted network. One of the most common is "The hosted network failed to start. The resource group or state is not in a valid format." This is often related to drivers or the WLAN autoconfiguration service.
Check the service WLAN AutoConfigIt must be running and set to "Automatic" startup type. If the service is stopped, the network will not be created. Also, try reinstalling the wireless adapter driver, selecting the generic Microsoft driver instead of the manufacturer-specific driver, if the problem persists.
Another common problem is the inability to change the channel or frequency. Some adapters are tightly bound to regional settings and do not allow changing the frequency via netshIn such cases, changing regional settings in the registry or through the Device Manager (Advanced tab) can help.
Is it possible to share 5GHz Wi-Fi via the command line?
Yes, this is possible if your adapter supports the 5 GHz band. To do this, add the channel parameter to the network creation command, for example: netsh wlan set hostednetwork mode=allow ssid=MyNet key=Pass123 channel=36However, not all drivers handle this parameter correctly.
How many devices can be connected simultaneously?
The theoretical Windows limit is up to 100 connections, but the actual number depends on the power of the wireless adapter and processor. For stable operation, it is recommended to connect no more than 5-8 devices to avoid overloading the channel.
Does this method work on Windows 11?
Windows 11 has command support netsh wlan set hostednetwork has been officially deprecated. The system may return an error or ignore the command. In Windows 10 and 11, it's preferable to use the built-in "Mobile Hotspot" feature in Settings, which uses the same mechanisms but is managed through a modern interface.