How to Share Wi-Fi from a Laptop Using the Command Line: An Expert Guide

Many users are familiar with the situation where cable internet is only available on one device, and the Wi-Fi router suddenly fails or is unavailable. In such situations, a laptop can become a fully functional router replacement if you know how to properly activate a hidden Windows feature. Using the graphical interface isn't always effective, especially on older versions of the operating system or when services are down, so command line remains the most reliable tool for solving the problem.

This method allows you to create a virtual adapter that broadcasts a signal to smartphones, tablets, and other devices without an Ethernet port. The main advantage of using the console is its minimal system resource consumption and the ability to deeply diagnose problems at the driver level. You don't need to install third-party software, which often contains ads or hidden data collection modules.

Before you start entering commands, you need to make sure that the device has a working one. wireless network driver and the Wi-Fi module itself is active. Even if you're connected to the network via cable, the adapter must be enabled physically or software-based, otherwise the system won't be able to start access point emulation mode. Check for the wireless network icon in the system tray or device manager before starting.

Preparing the system and checking hosting support

The first step is to launch the console with administrator rights, as regular user rights do not allow you to make changes to network configurations. Press the key combination Win + X and select "Windows PowerShell (Admin)" or "Command Prompt (Admin)". In the window that opens, enter the command netsh wlan show drivers and press Enter to get the driver status report.

In the list of parameters that appears, find the line "Hosted network supported." If it says "Yes," your adapter is ready to use. A "No" indicates that the driver doesn't support this feature or the device is too old. In this case, try updating the adapter's firmware through Device Manager or the manufacturer's website.

It's worth noting that some modern laptops with integrated Intel or Realtek modules may require manual virtualization activation in the BIOS, although this is rare. Also, make sure that Internet Connection Sharing isn't blocked by antivirus software or corporate security policies if you work in an office.

⚠️ Note: If hosting support isn't present in the driver report, you won't be able to share your internet connection using standard methods. Try removing the device in Device Manager and performing a "Scan for hardware changes" action to ensure Windows reinstalls the driver with the correct settings.
📊 What version of Windows are you using to share Wi-Fi?
Windows 10
Windows 11
Windows 8.1
Windows 7
Other

Creating and configuring a virtual access point

After confirming technical feasibility, you need to create the network itself, assigning it a name (SSID) and a password to protect it from unauthorized access. The command follows a strict template, so it's important to maintain the correct syntax. Enter the following line: netsh wlan set hostednetwork mode=allow ssid=MyNetwork key=MyPassword123. Here MyNetwork — this is the name of your network, and MyPassword123 — password, which must contain at least 8 characters.

Parameter mode=allow Allows the virtual adapter to run. If you want to prevent the network from being created in the future, simply change the value to disallowThe network name may contain spaces, but in this case it is better to enclose the entire SSID structure in quotation marks, although the standard syntax is netsh usually handles spaces correctly without them, unless they are at the beginning or end.

The security of the newly created network is ensured by the WPA2-Personal encryption protocol, which is used by default. This means that intercepting traffic using conventional means is extremely difficult. However, it's important to avoid using passwords that are too simple, as brute-force attacks against weak keys can be performed in minutes, even on mobile devices.

After the command is successfully executed, the system will report that the local network group settings have been changed. The virtual adapter has now been created in the system, but it is not yet active and does not broadcast a signal. A separate command is used to initiate broadcasting, which we will discuss in the next section.

Launching the network and providing public access

To activate the created access point, enter the command netsh wlan start hostednetworkIf everything went well, you'll see the message "Hosted network started." The name you specified earlier should now appear in the list of available Wi-Fi networks on your phone or other laptop. However, the internet will not work on connected devices yet.

To share your internet connection, you need to open the network connections window. This can be done quickly by typing the following command in the Run window (Win + R). ncpa.cplFind your primary internet connection (this could be an Ethernet cable or other Wi-Fi connection), right-click it, and select "Properties."

In the window that opens, 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). Click "OK" to save the settings.

☑️ Checking Internet distribution

Completed: 0 / 4

After applying the settings, Windows may automatically assign an IP address to the virtual adapter. If this doesn't happen, and the devices connect but report "No Internet Access," try disabling and re-enabling the primary shared connection. Sometimes the system needs a few seconds to redistribute data streams.

Network Management: Stop and Delete Configuration

When the need for internet sharing is no longer present, the network should be gracefully stopped to free up adapter resources and avoid wasting battery power. To do this, use the command netsh wlan stop hostednetworkOnce completed, the signal broadcast will stop, but the settings will be saved for the next launch.

If you want to completely remove the created configuration, for example to change the security type or network name from scratch, use the command netsh wlan set hostednetwork mode=disallowThis action deactivates the virtual driver. To reactivate it, you will need to re-enter the SSID and key parameters, as described in the setup section.

It is convenient to create two text files with extensions .bat: one to start, one to stop. In the file for starting, put the line netsh wlan start hostednetwork, and in the file for stopping - netsh wlan stop hostednetworkThese scripts must always be run as administrator, otherwise the commands will not be executed.

How to make shortcuts always run as administrator?

Create a shortcut to the bat file, right-click it, select Properties -> Advanced, and check "Run as administrator." Now, double-clicking it will immediately prompt you for UAC permissions.

This approach significantly speeds up the process of switching laptop modes. You can place shortcuts on the desktop or pin them to the taskbar for quick access in critical situations when urgent network access is needed for colleagues or clients.

Diagnosis of typical errors and their solutions

The most common issue is the error "Unable to place the network. The group or resource is not in the correct state." This often occurs if the wireless adapter driver is frozen or conflicts with the Microsoft virtual adapter. The solution is to restart the computer or temporarily disable the Wi-Fi adapter in Device Manager and then re-enable it.

Another common situation is that devices connect, but the internet doesn't work. In this case, check whether the IP address of the virtual adapter has changed after rebooting. In the IPv4 properties of the virtual adapter (in the ncpa.cpl) try to register a static address, for example, 192.168.137.1 with a mask 255.255.255.0, and specify it in the DNS settings 8.8.8.8.

Problems can also be caused by power saving settings. Windows may disable the adapter to save power, which interrupts the connection. To avoid this, open Device Manager, find your Wi-Fi adapter, open its properties, and uncheck "Allow the computer to turn off this device" in the "Power Management" tab.

Error / Symptom Probable cause Solution method
Failed to place network The driver does not support the mode or is busy Update the driver, restart the PC
No internet access Network Address Translation (NAT) is not configured. Check the "Access" tab in the properties
The network disappears after 5 minutes Adapter power saving Disable power saving in Device Manager
Devices don't see the network Invalid region or channel Check the region settings in the registry
⚠️ Note: Network connection interface numbers may change (for example, "Connection 4" will become "Connection 5") after updating drivers or connecting new devices. Always check the current virtual adapter number before setting up sharing.

Alternative methods and mobile hotspot

Windows 10 and newer operating systems feature a built-in feature called "Mobile Hotspot," which allows you to share a Wi-Fi connection without using the command line. It's located in "Settings" -> "Network & Internet" -> "Mobile Hotspot." This method is more convenient for casual users, as it doesn't require memorizing commands.

However, the console method through netsh Provides more flexible control over parameters, for example, allowing you to force the frequency range (2.4 GHz or 5 GHz) if the driver and adapter support it. The command looks like this: netsh wlan set hostednetwork band=a for 5 GHz or band=g for 2.4 GHz. This is useful in noisy environments.

For older versions of Windows (7, 8), the command line remains the only native way to set up an access point without installing third-party software like Virtual Router or Connectify. While these programs are convenient, they often add unnecessary system overhead, which can lead to system sluggishness on low-end laptops.

Using PowerShell instead of CMD gives the same results for commands netsh, but offers more powerful automation and scripting tools if you need complex connection logic. The basic command syntax remains the same across all shells.

Questions and Answers (FAQ)

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

Yes, it is possible, but it requires two wireless adapters (for example, a built-in one and a USB dongle) or driver support for Wi-Fi Direct technology. The standard method is via netsh Typically uses one adapter for both receiving and distributing, switching between modes, which can result in reduced speed.

Why does the start hostednetwork command give an error?

The most common cause is the wireless network driver. Try uninstalling the device in Device Manager and refreshing the configuration. Also, make sure you're running the command prompt as an administrator, otherwise you won't have sufficient access rights.

Will this method work on Windows 11?

In Windows 11, command support hostednetwork Formally preserved, Microsoft is actively promoting the built-in "Mobile Hotspot." In some Windows 11 builds, the virtual driver may be hidden, and the command line method will require additional registry manipulation or installation of legacy drivers.

What is the maximum range of this access point?

The range is determined by the power of your laptop's antennas and is typically 10-15 meters indoors without any structural walls. A laptop isn't a dedicated router, so the signal penetration will be lower than that of a full-fledged router with external antennas.