How to Share WiFi Using the Command Line: A Complete Guide

Many people are familiar with the situation of urgently needing internet access for a smartphone, tablet, or other laptop, but don't have a router at hand. In such cases, a built-in Windows feature often comes to the rescue, allowing you to turn your computer into a fully-fledged access point. However, the standard settings interface may be unavailable, blocked by the administrator, or simply malfunction due to driver issues.

It is at such moments that help comes to the rescue command lineThis is a powerful tool that allows you to manage network adapters at a low level, bypassing the system's graphical limitations. Using the console, you have direct access to the service. WLAN AutoConfig, which makes it possible to start a distribution even when the usual buttons in the menu are inactive.

In this article, we'll cover the process of creating a virtual access point in detail. You'll learn how to create the correct requests, change security settings, and diagnose problems if a connection fails. This is a skill that will save both system administrators and regular users in a critical moment.

Checking network support and preparing the adapter

Before attempting to share, you need to ensure that your network adapter is technically capable of operating in virtual access point mode. Not all wireless modules support this feature, especially on very old laptops or when using specific drivers. The first step should always be to diagnose your hardware's capabilities.

To check, run the command prompt as administrator. Enter the command netsh wlan show drivers and press Enter. In the list of options that opens, find the line "Hosted network supported." If it says "Yes," your adapter is ready to use. If it says "No," you won't be able to start sharing software—you'll need to replace the adapter or update the drivers.

⚠️ Warning: If support is listed as "No", do not try to use third-party emulator programs, they also rely on this system flag and will not be able to bypass the hardware limitation.

It's also worth checking whether the WiFi module itself is enabled. Sometimes it can be disabled physically or programmatically in Device Manager. Make sure the driver is installed correctly and the device is working properly, without resource conflicts.

Setting up a network name and security password

After confirming the technical feasibility, you need to configure the parameters of the network you're creating. You'll need to create a name (SSID) that other devices will see and set a strong password. An encryption protocol is typically used in this case. WPA2-Personal, which provides a sufficient level of protection for home use.

Command entry must be precise, without extra spaces, and case-sensitive. The syntax requires keywords. set hostednetwork, followed by the mode, name, and key parameters. A single character error will result in the system returning a message about an invalid request format.

netsh wlan set hostednetwork mode=allow ssid=MyVirtualWiFi key=SuperPassword123

In this example MyVirtualWiFi — is the name of the network, and SuperPassword123 — password. You can replace these with any values ​​you like, but remember that the password must be at least 8 characters long. If you use Cyrillic characters in the network name, ensure that client devices correctly display Russian letters, although using Latin characters is recommended for maximum compatibility.

Launching a virtual access point

Once the parameters are set, the network isn't yet active. It's simply configured in the system. To begin broadcasting, you need to send a start command. This activates the virtual adapter, and your computer begins broadcasting the signal. The process usually takes no more than a few seconds.

To activate, enter the following command:

netsh wlan start hostednetwork

If everything went well, you'll see the message "Hosted network started." From now on, the name you created should appear in the list of available WiFi networks on your phone or tablet. However, for devices to access the internet, and not just connect to the local network, there's one more critical step: setting up sharing.

There are times when an error occurs during startup. This is often due to the WLAN AutoConfig service being stopped. Check its status via services.msc and make sure it is running and the startup type is set to "Automatic".

Setting up Internet access sharing (NAT)

The most important step is forwarding the internet connection. By default, the created virtual network is isolated. To allow it to access the global network through your main connection (be it an Ethernet cable, another WiFi network, or a 4G modem), you need to enable bridged or shared mode in the network adapter properties.

Open "Control Panel" → "Network and Internet" → "Network and Sharing Center." On the left, select "Change adapter settings." Find your primary adapter through which your computer connects to the internet (for example, "Ethernet" or "Wireless"), right-click it, and select "Properties."

Go to the "Access" tab. Check the box next to "Allow other network users to connect through this computer's Internet connection." Below, in the "Home networking connection" drop-down list, select the virtual adapter you created earlier (usually called "Local Area Connection" with a number like 13 or 14, and with a status of "No Internet access" until enabled).

Parameter Meaning / Action Description
Interface Main adapter An adapter that has a real network connection
Tab Access Properties section for NAT configuration
Action Allow access Activating traffic forwarding
Target network Virtual adapter Network created with the netsh command

After applying the settings, the system may warn that the IP address of the adapter will be changed to 192.168.137.1This is normal behavior, so agree. Your devices should now receive IP addresses automatically and have full network access.

📊 What is your primary internet source on your PC?
Ethernet cable (Provider)
Mobile Internet (USB modem)
Another WiFi adapter
Don't know/Other

Network management and stopping distribution

A virtual hotspot doesn't have to be running all the time. You can easily enable and disable it as needed, without having to delete the settings each time. This is convenient for saving laptop resources or when you need to temporarily grant access to a guest.

To stop broadcasting, use the command:

netsh wlan stop hostednetwork

Once completed, the network will disappear from view of devices but retain its settings (name and password). To restart it, simply enter the command start, which was mentioned above. If you want to change your name or password, you will have to use the command again. set with new parameters, after stopping the network.

⚠️ Note: When you shut down your computer or enter sleep mode, the virtual network is also disabled. You will likely need to restart it manually the next time you log in.

To completely remove the configuration and return the adapter to its original state, use the command netsh wlan set hostednetwork mode=disallowThis is useful if you no longer plan to use this distribution method or want to eliminate potential driver conflicts.

Troubleshooting and troubleshooting

Despite the simplicity of the method, users often encounter errors. One of the most common is "Failed to start hosted network." This can occur for a number of reasons, ranging from a disabled service to an IP address conflict or incorrect driver settings.

Try updating your wireless adapter drivers. Go to Device Manager, find your WiFi module, right-click it, and select "Update driver." If that doesn't help, try uninstalling the device and restarting your computer to let Windows reinstall it. It's also worth checking whether your antivirus or firewall is blocking new connections.

If the devices connect but the internet doesn't work, check your DNS settings. Try manually entering Google's DNS servers (8.8.8.8 And 8.8.4.4) in the virtual adapter properties (IP protocol version 4). Also, make sure that the primary adapter actually has internet access when sharing.

☑️ WiFi Startup Checklist

Completed: 0 / 5

Frequently Asked Questions (FAQ)

Is it possible to share WiFi if the laptop itself is connected to WiFi?

Technically, this is possible, but requires two wireless adapters or support for a special technology (Virtual WiFi), which allows one adapter to simultaneously receive and transmit. However, most often, distributing WiFi over WiFi requires the primary internet connection to be provided via an Ethernet cable, or using a single adapter that switches to access point mode, breaking the connection to the router.

Why does the phone see the network, but says "Unable to connect"?

Most often, the problem is an incorrect password or encryption type. Make sure you didn't use any special characters when entering the command, as they could be interpreted incorrectly. Also, try deleting the saved network on your phone and reconnecting. Sometimes changing the region in the adapter settings helps.

Are the settings reset after restarting Windows?

The network configuration itself (name and password) is saved in the registry. However, the "running" status is not saved. You'll have to re-enter the command after each computer reboot. netsh wlan start hostednetworkTo automate this process, you can create a bat file and run it as administrator.

How to increase the range of such an access point?

The command line doesn't directly control the antenna's transmit power. The range depends on the capabilities of your adapter and any external obstructions. You can try finding the "Transmit Power" parameter in the adapter's properties in Device Manager and setting it to the maximum value, if the driver allows it.

Is it safe to use this method in public places?

Using WPA2 encryption makes the connection fairly secure against simple data interception. However, by turning your PC into a hotspot, you assume responsibility for the traffic of all connected users. It's best to refrain from sharing data in public places, or use complex passwords and limit the number of connections.