Sharing Wi-Fi from a laptop to a phone using the Windows 10 command line

In today's digital world, access to the global network is constantly required, and often a computer has wired internet but a smartphone doesn't. Situations where you urgently need to update an app, download a work document, or simply save mobile data arise regularly. Fortunately, the operating system Windows 10 has built-in functionality that allows you to turn your laptop into a full-fledged wireless router.

Using the command line for these purposes may seem complicated at first glance, but this method is the most reliable and flexible. Unlike third-party programs, the system utility doesn't consume unnecessary CPU resources and guarantees a stable connection. You don't need to download questionable software; all you need is a few basic console commands.

This article will detail the process of creating a virtual access point. We'll cover preparing the equipment, entering commands, configuring security settings, and troubleshooting common errors. You'll learn how to manage the network interface at a deep level, which is useful not only for internet sharing but also for general network troubleshooting.

⚠️ Attention: Network adapter interfaces and service names may vary slightly depending on the Windows 10 build version and installed drivers. If the commands don't work, check that your Wi-Fi module drivers are up-to-date in Device Manager.

Checking network interface hosting support

Before running complex scripts, you need to make sure that your Wi-Fi adapter Technically capable of operating in access point mode. Not all wireless modules support the hosted network feature, although modern devices do. This can be verified using the standard network management console.

Open a command prompt with administrator rights. To do this, find the application in the Start menu. cmd, right-click and select "Run as administrator." In the window that opens, enter the command netsh wlan show drivers and press Enter. The system will display a detailed report on your wireless connection drivers.

In the list that appears, find the line "Hosted network supported." If the value is "Yes," your laptop is ready to use. A value of "No" indicates that the driver doesn't support this feature or it's disabled at the hardware level. In the latter case, you'll need to update the drivers from the manufacturer's website.

  • 📡 Make sure that the Wi-Fi module is physically turned on (the indicator is on or the switch on the case is active).
  • 💻 Run the console only with administrator rights, otherwise the commands will be blocked by the system.
  • 🔄 If the value is "No", try removing the device in Task Manager and updating the hardware configuration.
📊 Does your adapter support hosted networking?
Yes, I saw "Yes"
No, it was "No"
I haven't checked.
I use third-party software

Creating and configuring a virtual access point

Once support is confirmed, you can begin creating the virtual interface. The command netsh Allows you to set a network name (SSID) and a password for connection. The name can be anything you want, and the password must contain at least 8 characters, including letters and numbers, for secure encryption. WPA2-Personal.

Enter the following statement into the command line: netsh wlan set hostednetwork mode=allow ssid=MyNetworkName key=MyPassword123. Replace MyNetworkName to the desired network name, and MyPassword123 to your complex password. After pressing Enter, the system will notify you that the settings have been successfully changed.

If you plan to use this feature frequently, it's a good idea to remember or save the command in a text file. In the future, to change the password or network name, simply enter the same command with the new parameters, and the system will automatically update the settings without having to delete the old profile.

netsh wlan set hostednetwork mode=allow ssid=HomeWiFi key=SecurePass2026

☑️ Configuring network settings

Completed: 0 / 4

Starting Wi-Fi signal distribution

Configuring the settings doesn't mean the network is active and broadcasting a signal. To launch the virtual router, you need to send the start command. This activates the wireless adapter in base station emulation mode.

Use the command netsh wlan start hostednetworkIf everything went well, you'll see a message stating that the hosted network has started. The SSID and access key you set earlier will also appear. Your laptop is now visible to other devices within Wi-Fi range.

However, at this stage, the phone, even after connecting to the network, will likely not have internet access, as we've only created a local network and haven't configured traffic routing. For full functionality, another important step is required: forwarding connections.

  • 🚀 The launch command activates signal emission, but does not configure the Internet.
  • 📶 Devices can connect to the network, but pages in the browser are not yet loading.
  • 🔌 Make sure your laptop is connected to the internet via a cable or other adapter.

⚠️ Attention: If you receive the error "Failed to start hosted network" upon startup, try temporarily disabling your antivirus or firewall, as they may be blocking the creation of virtual interfaces.

Expanding Internet Access (NAT)

The most important step is forwarding the internet connection. You need to allow devices connected to your virtual hotspot to use your laptop's active internet connection. This is done through the Network and Sharing Center.

Click Win + R, enter ncpa.cpl and press Enter. The Network Connections window will open. Find your primary adapter that connects your laptop to the internet (e.g., Ethernet or Wi-Fi). Right-click it, select Properties, then the Sharing tab.

Check the box "Allow other network users to connect through this computer's Internet connection." In the "Home network connection" drop-down list, select the virtual network you created (usually it's called "Wireless Network Connection" with a number, for example, Wireless network connection 19).

Action Location Target
Open properties ncpa.cpl -> Right-click Accessing adapter settings
Access tab In the properties window Setting up sharing
Network selection Drop-down list Specifying a virtual adapter
Preservation OK button Applying NAT settings

Stopping distribution and managing the network

When you no longer need to use mobile internet on your laptop, you should gracefully shut down the network. This will free up the Wi-Fi module's resources and stop transmitting the signal, which also serves as a security measure.

To stop, use the command netsh wlan stop hostednetworkAfter this is done, the devices will lose connection to your access point.

If you want to completely delete the created network and reset the settings, use the command netsh wlan set hostednetwork mode=disallowThis action will disable the ability to create a hosted network until you enable it again with the command mode=allow.

  • 🛑 Stopping the network is necessary to save the laptop battery.
  • 🧹 A complete deletion of settings is required when changing the name or encryption type.
  • 🔄 Restarting the network often resolves connection issues without reinstalling drivers.

⚠️ Attention: After shutting down the laptop or entering sleep mode, the virtual access point may be disabled. In this case, you will need to re-enter the startup command each time you turn on the computer.

How to make network startup automatic?

To automatically start the network when Windows starts, create a bat file with the startup command, place it in the startup folder (shell:startup) and configure it to run as administrator using the Task Scheduler.

Diagnosis and solution of typical problems

Despite the simplicity of the method, users often encounter errors. One of the most common is "The hosted network failed to start. The group or resource is not in the correct state." This often indicates a driver conflict or disabled services.

Check the Internet Connection Sharing (ICS) service. Click Win + R, enter services.mscFind the service related to sharing in the list and make sure it's running and the startup type is set to "Automatic." Without this service, traffic forwarding won't work.

Problems can also be caused by power saving. In Device Manager, find your Wi-Fi adapter, open its properties, and under the "Power Management" tab, uncheck "Allow the computer to turn off this device to save power." This will prevent the module from shutting down at a critical moment.

Why does the phone see the network but not connect?

Most often, the problem lies in an incorrectly entered password or an incompatible encryption standard. Try changing the password to a simpler one (numbers only) to test. Also, make sure your phone doesn't have a static IP address that conflicts with your laptop's range.

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

Technically, this is possible, but requires two Wi-Fi adapters or Wi-Fi Direct support on the specific adapter. In a typical scenario, a laptop receives internet via Wi-Fi and distributes it via a cable, or receives via a cable and distributes it via Wi-Fi. A single adapter can rarely simultaneously receive and broadcast a signal in access point mode.

How to increase distribution speed?

Speed ​​is limited by the power of your Wi-Fi module and frequency range. If your adapter supports 5 GHz, configure your network to use that frequency for maximum speed. Also, close background downloads on your laptop to free up bandwidth for mobile devices.

Is it safe to share internet via cmd?

Yes, using built-in Windows commands is safer than installing unknown seeders. However, use a strong WPA2 password to prevent neighbors or passersby from connecting to your network and using your data.