How to enable Wi-Fi on a laptop using the command line

Modern operating systems offer convenient graphical interfaces for managing network connections, but sometimes standard methods stop working or are unavailable. Situations requiring the use of a command line to enable Wi-Fi on a laptop arise quite frequently: this may be due to corrupted system files, a blocked interface service, or the need for remote administration. Using the command line allows you to bypass many software restrictions and gain direct access to the wireless adapter drivers.

Working with the console requires a certain amount of attention, as it lacks the familiar "Enable" or "Connect" buttons found in the Windows interface. All actions are performed by entering text commands that are sent to the operating system kernel. Command line The Windows command line (cmd) offers powerful tools for network diagnostics and management, often more effective than standard troubleshooting tools. If your wireless network icon has disappeared or the system is reporting "Wi-Fi is disabled," the command line can be a lifesaver.

In this article, we'll walk you through the process of activating the wireless module, checking its status, and even creating an access point. You'll learn how to use the utility. netsh, which is the primary tool for a Windows network administrator. Understanding these processes will not only allow you to quickly restore connections but also provide a deeper understanding of how your device's network interfaces operate.

Preparing to work with the console and running as administrator

Before entering any commands, you must obtain the appropriate access rights. Windows operating systems, starting with Vista and later, strictly control changes to system settings, including network adapter management. Attempting to enable Wi-Fi on a laptop from the command line without administrator rights will result in an "Access Denied" error. Therefore, the first step should always be to properly launch the terminal.

There are several ways to open the desired tool. The fastest is to press a key combination. Win + R, enter cmd and press Ctrl + Shift + EnterThis combination immediately requests elevated privileges. Alternatively, search for "Command Prompt" or "Windows PowerShell" in the Start menu, right-click, and select the appropriate option. In newer versions of Windows 10 and 11, PowerShell often replaces the classic cmd, but the basic commands netsh work in both environments equally.

⚠️ Warning: When working in the console with administrator rights, you have full control over the system. Be extremely careful when entering commands, especially those related to deleting profiles or resetting settings, as errors can lead to the loss of saved Wi-Fi passwords.

After launching the window with a black background, make sure that the window title indicates the path to the system folder System32 and username AdministratorThis ensures that subsequent commands will run successfully. If you plan to use this tool frequently, you can create a desktop shortcut with pre-configured launch permissions, which will save you time in the future.

📊 Which method of launching the console do you use most often?
Via Windows Search
Via the Start menu (right-click)
Via Win+R
Via Task Manager

Diagnosing the status of a wireless adapter

After successfully launching the terminal, the first thing you need to do is check whether the operating system sees your wireless module and what its status is. It often happens that the driver is installed, but the interface itself is disabled by software. To obtain complete information about network interfaces, use the command netsh interface show interfaceIt will display a list of all available connections with their current status.

In the resulting list, pay attention to the "Name" and "State" columns. A wireless adapter is typically named "Wireless Network" (or "Wi-Fi" in the English version) and "Wireless Network Connection." If the status column says "Disconnected" or "Not Connected," the adapter is physically or software-disabled. If the adapter doesn't appear in the list at all, the problem may lie with the drivers or a hardware issue.

netsh interface show interface

For a more detailed check of wireless networks, there is a separate command netsh wlan show interfacesIt will show not only the connection status, but also the SSID of the network you're connected to (if connected), the signal strength as a percentage, the data transfer rate, and the type of security used. Output analysis This command helps determine whether the radio module is working at all. If the command returns a message about no wireless interfaces, it means the WLAN AutoConfig service isn't running or the driver has crashed.

It's also a good idea to check if your adapter supports hosted networking if you plan to share the internet. The command netsh wlan show drivers will display detailed driver information. The "Hosted network support" line should say "Yes." If it says "No," you won't be able to launch the access point using standard tools, and you'll need to update the drivers or replace the adapter.

What to do if the adapter is not found?

If the show interface commands don't show the wireless adapter, try running devmgmt.msc to open Device Manager. Check the "Network Adapters" section for devices with a yellow exclamation point. The device may be hidden (View -> Show hidden devices) and need to be enabled manually or the driver reinstalled.

Activating the Wi-Fi interface via netsh

If diagnostics show that the interface exists but is in the "Disabled" state, it must be forced to reactivate. This is where the utility's power comes in. netshThe command to enable the interface is simple, but requires precise knowledge of its name, which we learned in the previous

at this stage. The command syntax is as follows: netsh interface set interface name="Name" admin=enabled.

Replace "Name" with the exact name of your adapter as it appears in the list. In Russian versions of Windows, this is most often "Wireless Network" or "Wi-Fi." Note the quotation marks: if the name consists of multiple words or contains spaces, they are required. If the name is monosyllabic (for example, "Wi-Fi" in some builds), you can omit the quotation marks, but their presence is always a valid error.

netsh interface set interface name="Wireless Network" admin=enabled

After entering the command and pressing Enter, the system should confirm execution by pressing "Ok." If you receive an error message, check the spelling of the interface name—case isn't important, but spaces and special characters must match exactly. After the command is successfully executed, the network icon in the system tray should change its state, and the search for available networks will begin.

To disable the interface, use a similar command, but with the parameter admin=disabledThis can be useful if you need to quickly reset network settings or temporarily disable a module to save power without physically turning off the laptop. Restarting the interface (turning off and then turning on) often solves the problem of a "frozen" connection better than a complete reboot of the computer.

☑️ Check Wi-Fi activation

Completed: 0 / 5

Managing profiles and connecting to the network

Once the interface is activated, the laptop begins scanning the air. However, automatic connection may fail if the network profile has been deleted or damaged. In this case, you'll need to connect manually or create a new profile. The command netsh wlan show networks mode=bssid Allows you to see a list of all available networks within range, including hidden ones, and their technical parameters (channel, encryption type).

To connect to a known network, simply enter its name (SSID). If the network is open, the command is simple: netsh wlan connect name="Network_Name"If the network is password-protected and the profile hasn't been saved previously, the system will prompt you to enter a security key. However, it's often more convenient to create a profile with a password directly from the command line, rather than entering it through the graphical interface.

To create a profile, use the add profile command from an XML file or a direct command specifying the key. An example of creating a profile with WPA2-Personal security:

netsh wlan add profile filename="C:\path\to\profile.xml"

It is often necessary to delete an old, conflicting profile. The command netsh wlan delete profile name="Network_Name" Completely clears saved data about a specific network, including passwords and IP settings. This is a "clean" way to resolve connection issues when the system attempts to use old, incorrect security settings.

Team Description of action Example of use
show profiles Shows a list of all saved networks. netsh wlan show profiles
delete profile Deletes a specific network profile netsh wlan delete profile name=HomeWiFi
connect Establishes a connection to the network netsh wlan connect name=HomeWiFi
set profileorder Sets the priority of network connections netsh wlan set profileorder name=HomeWiFi interface="Wi-Fi" priority=1

Creating an access point (Hotspot) via the console

One of the most sought-after features for advanced users is the ability to share internet from a laptop to other devices, turning it into a router. The standard "Mobile Hotspot" feature in Windows 10/11 is convenient, but the command line offers more precise control. First, configure the hosted network settings: name (SSID) and password.

The installation command looks like this: netsh wlan set hostednetwork mode=allow ssid="MyNetwork" key="Password123". Here mode=allow allows the virtual adapter to start, ssid sets the name that other devices will see, and key Sets a password (minimum 8 characters). After setting up the network, you need to start it with the command netsh wlan start hostednetwork.

⚠️ Note: The hosted network feature in Windows 10 and 11 is deprecated and may not work with some newer Wi-Fi adapters or drivers. If the start command returns the error "Failed to start hosted network," try updating your drivers or using the built-in "Mobile Hotspot" feature in the system settings.

After successfully launching the virtual network, the internet will not automatically connect to the connected devices. You will need to access the properties of your primary internet connection (via ncpa.cpl), select the "Access" tab and allow other users to use this connection by selecting the created virtual connection from the list (usually "Local Area Connection *").

To stop distribution, use the command netsh wlan stop hostednetwork, and to completely remove the settings - netsh wlan set hostednetwork mode=disallowThis is a convenient way to quickly set up a temporary network for file transfer or internet access for colleagues without having to configure the main router.

Resetting settings and troubleshooting common errors

Even if you enter the commands correctly, errors may occur. One of the most common is "The WLAN AutoConfig service is not running." In this case, no commands will work. netsh won't work. You need to start the service manually. In the command line, this is done with the command net start wlansvcIf the service starts and then immediately stops, check the Windows event log for critical driver errors.

Another common issue is TCP/IP settings desynchronization. If Wi-Fi is enabled and the network is visible, but there's no internet connection and pages aren't loading, a full protocol stack reset can help. While this isn't exactly a Wi-Fi control command, it often resolves related issues. Enter the following in sequence: netsh winsock reset And netsh int ip resetAfter this, a computer restart is required.

Also worth mentioning is the team ipconfig /release And ipconfig /renewThey allow you to reset the IP address received from the router. If your laptop is stuck with the address 169.254.xx, this means it hasn't received an address from the DHCP server, and resetting it often helps restore the correct settings.

netsh winsock reset

netsh int ip reset

ipconfig /flushdns

If nothing helps, and the adapter disappears from the device list even after a reboot, the power settings may be out of whack. Windows may be disabling the device to save power. You can check this in Device Manager, but it's more difficult to do in the console; you'll need to use PowerShell with the NetAdapter module cmdlets.

Why does the netsh wlan start hostednetwork command return an error?

Most often, the driver is the culprit. Go to Device Manager, find your Wi-Fi adapter, open its properties, and check the date in the "Driver" tab. Also, in the adapter's properties, under the "Advanced" tab, try disabling power saving options or 802.11n/ac mode.

Is it possible to run Wi-Fi in Safe Mode?

In classic Safe Mode, Wi-Fi drivers are usually not loaded. However, in Safe Mode with Networking, enabling Wi-Fi on a laptop via the command line is possible if the base-level drivers are functioning correctly.

How can I find out the exact name of the interface if it is in English?

Use the command netsh interface show interfaceThe name must be copied exactly, including spaces. In English Windows, this is usually "Wi-Fi," while in Russian, it's "Wireless Network" or "Wireless Network." A single letter error will result in the message "Interface not found."

Do these commands work in Windows 11?

Yes, basic netsh commands work in Windows 11. However, Microsoft is gradually migrating this functionality to a new PowerShell module (NetTCPIP, NetAdapter). For simple on/off tasks and creating profiles, old-school netsh commands remain fully functional and up-to-date.