How to create a WiFi hotspot using the command line

When you don't have a router handy and need to connect several devices to the internet at once, the built-in functionality of the Windows operating system becomes a real lifesaver. Many users don't even realize that setting up a local network doesn't require downloading third-party utilities or purchasing additional equipment. All you need is a computer with Wi-Fi adapter and access to the system.

Usage Command Prompt (CMD) allows you to transform your laptop or desktop PC into a fully-fledged router in minutes. This method is especially relevant for system administrators, IT professionals, or simply advanced users who value minimalism and the absence of unnecessary software. The main advantage is that you have complete control over the setup process and can easily change network settings.

In this article, we'll take a detailed look at how virtual adapters work in a Windows environment. You'll learn how to launch a network, manage connected clients, and troubleshoot common connection issues using only standard operating system tools.

Technology support check and preparation

Before starting any operations, you must ensure that your hardware and drivers support hosted network mode. Not all network cards can share the internet, although this capability is widely implemented in modern laptops. First, you need to launch the console with administrator rights.

To do this, press the key combination Win + X and select "Windows PowerShell (Administrator)" or "Command Prompt (Administrator)" from the menu. In the window that opens, enter the command to check your adapter's capabilities:

netsh wlan show drivers

In the list that appears, find the line "Hosted network supported." If it says "Yes," you can proceed. If it says "No," the problem lies either in the drivers, which need to be updated, or in the system itself. Wi-Fi module.

It's also important to check that the wireless module itself is enabled. Sometimes the physical button on the laptop or the software-based airplane mode switch can block the virtual adapter from launching. Make sure Wi-Fi is enabled on the computer itself, even if it's not currently connected to any network.

Setting up a network name and security password

The next step is to configure the access point you're creating. You'll need to create a network name (SSID) and a strong password. The WPA2-Personal encryption protocol, which is used by default in Windows, requires a password of at least 8 characters.

The following structure is entered into the command line, where you need to substitute your data instead of text values:

netsh wlan set hostednetwork mode=allow ssid="MyNetworkName" key="SecurePassword123"

Please note that it is better to enclose the network name and password in quotation marks if they contain spaces or special characters. Parameter mode=allow allows the network to start, and the command set hostednetwork saves these settings in the system, so you don't have to re-enter them every time you turn on your computer.

The security of the hotspot you create depends entirely on the strength of the password you choose. Avoid using simple combinations or dates of birth, as traffic in public places can be intercepted by hackers. WPA2 encryption secure, but only if you use a strong access key.

☑️ Pre-launch check

Completed: 0 / 4

Launching a virtual access point

After successfully configuring the settings, you need to activate the network. To do this, use the launch command, which instantly creates a virtual adapter in the system. The computer will begin broadcasting a signal, and your mobile device or tablet will be able to detect the new network in the list of available connections.

netsh wlan start hostednetwork

If everything is successful, you'll see the message "Hosted network started." At this point, devices can connect, but they won't have internet access yet. You'll see the connection status in the Windows notification area, where the number of connected clients will be displayed.

To stop Internet sharing, use a similar command with a different keyword:

netsh wlan stop hostednetwork

When you restart your computer, you will need to restart the network manually unless you create a special startup script.

📊 How often do you need to share Wi-Fi from your laptop?
Daily
Once a week
Only when traveling
Never, there is a router

Setting up Internet access sharing (NAT)

The most critical step is providing global network access to connected devices. Simply launching the network isn't enough; you need to configure network address translation (NAT) from the primary adapter (through which the PC accesses the internet) to the newly created virtual adapter.

Open the Network Connections window by typing the command ncpa.cpl in the Run window (Win + R). Find your primary internet adapter (Ethernet or Wi-Fi), right-click it, and select "Properties." Go to the "Access" tab.

In the "Internet Connection Sharing" section, check the "Allow other network users to connect through this computer's Internet connection" box. In the "Home networking connection" drop-down list, select the name of your virtual adapter (usually called "Local Area Connection" followed by a number).

Parameter Description Recommended value
SSID Wireless network name In Latin, without special characters
Key Access password Minimum 8 characters
Protocol Encryption type WPA2-Personal (AES)
Max clients Max. number of devices Default is 100
Channel Transmission channel Auto or 1-11

After applying the settings, you may need to restart the distribution. Run the stop and start commands for the network one by one (stop And start). Now connected gadgets should receive IP addresses automatically and have network access.

⚠️ Attention: If after turning on Internet sharing on the computer itself the Internet is lost, try disabling and re-enabling the main network connection in the window ncpa.cpl.

Managing connected clients

Windows provides convenient tools for monitoring who's connected to your hotspot. This is useful not only for curiosity but also for security reasons, allowing you to spot any uninvited guests early.

To view a list of all connected clients and their MAC addresses, use the following command:

netsh wlan show hostednetwork

At the bottom of the report is the "Clients" section, which displays the number of connected devices, their MAC addresses, and the connection's active time. If you notice an unknown device, you should immediately change the network password, as MAC address filtering is not possible using the standard command. netsh it is forbidden.

This menu also allows you to view the current network status, authentication type, and channel used. This information helps diagnose connection speed or stability issues. For example, if the channel is heavily loaded by neighboring routers, speed may drop.

Is it possible to limit the speed for clients?

It's not possible to limit bandwidth for individual clients using standard Windows tools. This requires third-party firewalls or specialized Wi-Fi distribution software that supports QoS.

Diagnostics of errors and

When creating an access point, users often encounter the error "Failed to start the hosted network. The group or resource is not in the correct state." This could indicate that the WLAN AutoConfig service is disabled or the network adapter itself is frozen.

First, check the service status. Click Win + R, enter services.msc and find "WLAN AutoConfig" in the list. Make sure it's running and the startup type is set to "Automatic." Without this service, Wi-Fi in Windows is completely impossible.

If the service is running, try deleting the virtual adapter and re-creating it. The deletion command looks like this:

netsh wlan delete hostednetwork

After deleting, re-configure the network settings using the command set hostednetwork and try running it. Often, simply updating the Wi-Fi adapter driver or reinstalling it through Device Manager with the "Delete driver software" option checked helps.

⚠️ Warning: Antivirus software and third-party firewalls may block the creation of a virtual adapter. If all else fails, try temporarily disabling your protection and testing the network.

Automating the process via a BAT file

Since Windows can't automatically launch the hosted network at system startup (this is a security limitation), manually entering commands each time is inconvenient. The solution is to create a simple script.

Create a text file and enter the startup commands (and configuration commands, if necessary) in the desired sequence. Save the file with the extension .bat, For example start_wifi.batThis file must be run as administrator.

For full automation, you can use Windows Task Scheduler, setting up a trigger for when a user logs on with the highest privileges. This will turn your laptop into a fixed access point that activates immediately after the OS boots.

Why do connected devices say "No Internet access"?

Most often, the problem lies in the network access control (NAT) settings. Make sure the adapter that connects the computer to the network is checked, and that the correct virtual adapter is selected in the list. Also, check whether the client is receiving an IP address automatically.

Is it possible to distribute Wi-Fi if the laptop itself is connected via Wi-Fi?

Theoretically, yes, but this requires two physical Wi-Fi adapters (or one very powerful one that supports multiple modes simultaneously, which is rare). Typically, a laptop receives internet via Wi-Fi and distributes it via a cable, or vice versa. Sharing Wi-Fi while receiving internet via Wi-Fi often requires virtualization or specific drivers.

What is the maximum range of such a point?

The range depends entirely on the antenna power of your laptop or PC. Typically, it's 10-15 meters indoors with obstacles. A laptop isn't a router, and its antennas are less powerful, so the coverage will be less than with dedicated equipment.