How to enable WiFi on a laptop using the command line

When the Windows graphical interface stops responding or network settings become blocked, users often find themselves caught off guard. In such cases, standard troubleshooting methods, such as toggling taskbar sliders, prove useless. The only reliable tool left is command line, which allows you to manage network services at a low level.

Using the console requires some caution, as you interact directly with the operating system without the protective filters of the graphical shell. However, this method often allows for recovery. wireless adapter, when drivers freeze or system services block the connection. Below, we'll detail the steps for different Windows versions.

⚠️ Warning: All commands must be entered exactly as they are written. Syntax errors may reset network settings or disable other important interfaces, such as Ethernet.

Launch Command Prompt with Administrator Privileges

The first and critical step is gaining the necessary privileges. Launching a regular console will not allow you to change system network settings, so the system will simply ignore your commands or return an access error. You need to run the terminal as administrator.

There are several ways to do this. The fastest is to press a keyboard shortcut. Win + X and select "Windows PowerShell (Administrator)" or "Command Prompt (Administrator)" from the menu that appears. Alternatively, enter cmd in the search, right-click on the result and select the appropriate item.

Once the window opens, make sure the title contains the path C:\Windows\system32\cmd.exe and have administrator rights. If you work on a corporate network, these rights may be limited by your organization's security policies.

☑️ Check access rights

Completed: 0 / 1

Successful launch is confirmed by the appearance of the system folder path at the beginning of the input line. The interface is now ready for management. network interfaces.

Diagnosing the status of a wireless adapter

Before attempting to enable the module, it's important to understand its current state. The system may consider the adapter disabled by software, physically disconnected, or in an error state. To get a complete picture, use the utility netsh.

Enter the following command to view a list of all interfaces and their status:

netsh interface show interface

In the list that appears, find the line containing the words "Wi-Fi," "Wireless," or "Wireless." Look at the "State" column. If it says "Disabled," the module is disabled by software. "Connected" means Wi-Fi is active, but the problem may be a lack of internet access.

It's also useful to know the exact interface name, as it may differ in different versions of Windows. The standard name in the Russian version is Wireless network, in English - Wi-FiFor accuracy, copy the name from the list or use the command:

netsh interface show interface name="Wireless Network"

This command will give detailed information about a specific module, including its MAC address and the current connection speed, if established.

Activating the WiFi interface using the netsh command

If diagnostics show that the interface is in the "Disabled" state, it can be activated with a single short command. This action is equivalent to toggling a slider in the settings, but is performed at the network core level.

Use the following syntax, substituting the name of your interface (if different from the default):

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

For the English version of Windows, the command will look like this: netsh interface set interface name="Wi-Fi" admin=enabledAfter entering the command, press Enter. If the command is successful, the system will not display any messages; it will simply move to a new line. This is normal console behavior.

⚠️ Note: Interfaces in Windows are case-sensitive and quotation marks sensitive. If the interface name contains spaces, quotation marks are required, otherwise the command will be interpreted incorrectly.

To verify that the module is enabled, repeat the diagnostic command from the previous section. The status should change to "Connected" or the system should begin searching for available networks. If the status doesn't change, a restart of the WLAN service may be required.

📊 What was your WiFi status before using the command?
Disabled: Unknown: Driver Error: Adapter not found

Sometimes changes don't take effect immediately. It may take a few seconds for them to initialize. communication protocols and obtaining an IP address from the router.

Restarting network services via console

There are cases where the interface itself is enabled, but the WiFi module doesn't respond to commands or is stuck in an error state. In this situation, the most effective way is to restart the service responsible for wireless connections. In Windows, this service is called WLAN AutoConfig.

The command is used to manage services. netFirst, let's stop the service:

net stop wlansvc

The system will confirm the action with a successful stopping message. Then, restart the service:

net start wlansvc

This process completely resets the state of the WiFi-related network stack. This often helps resolve DHCP errors or authentication issues that aren't resolved by simply reconnecting.

Team Action Result
net stop wlansvc Service stop Temporarily disable all WiFi functions
net start wlansvc Starting the service Initializing the module again
sc query wlansvc Checking status Display the current service status

After restarting the service, it is recommended to wait approximately 10-15 seconds before attempting to connect to the access point. This time is required for the operating system to load all dependent components.

Resetting network settings and TCP/IP stack

If enabling the module doesn't help establish a connection, the problem may lie deeper—corrupted network protocols or incorrect TCP/IP settings. In this case, a full reset of network settings to factory defaults is required.

Run the following commands in sequence, pressing Enter after each:

netsh winsock reset

netsh int ip reset

ipconfig /release

ipconfig /renew

ipconfig /flushdns

Team netsh winsock reset Resets the Winsock directory, which often resolves internet connection issues caused by malware or driver failures. Resetting the IP clears the protocol configuration, and the commands ipconfig update the address lease and DNS cache.

What to do if reset commands don't help?

If resetting the TCP/IP stack doesn't resolve the issue, try uninstalling the device from Device Manager. Find your wireless adapter, right-click it, and select "Uninstall device." Then, from the Actions menu, select "Scan for hardware changes" to have Windows reinstall the driver.

It is important to note that after completing these steps rebooting the computer is mandatory. Without a reboot, changes to the registry and system files will not take full effect.

Analyzing logs and troubleshooting driver errors

When software methods fail, it's worth checking the system logs. Windows keeps detailed records of connection attempts and driver errors. You can view them using the built-in utility or the command line.

To quickly view the latest network-related errors, use the command:

wevtutil qe Microsoft-Windows-WLAN-AutoConfig/Operational /c:5 /f:text

This command will display the last five events from the WLAN autoconfiguration log. Look for error codes or messages indicating that the driver failed to initialize the device. This issue is often caused by a driver version conflict after a Windows update.

If you're seeing persistent initialization errors, it might be worth checking if your laptop has a physical WiFi switch. Some models HP, Lenovo And Asus have a hardware lock that cannot be removed using software commands.

⚠️ Note: If the event log shows errors related to turning off the device's power to save energy, disable this option in Device Manager in the properties of your WiFi adapter on the "Power Management" tab.

It's also worth checking whether your antivirus or firewall is blocking the network module. Temporarily disabling third-party security tools can help determine whether they're causing the problem.

Frequently Asked Questions (FAQ)

Is it possible to enable WiFi via the command line if the driver is not installed?

No, the command line manages devices already installed in the system. If the driver is missing or the device is not detected by the system (shown as "Unknown Device"), the commands netsh will have no effect. You must first install the driver from another drive or via an Ethernet cable.

What should I do if the command says "Access Denied" even though I'm an administrator?

This can happen if the console isn't running as an administrator, or if your antivirus software is blocking changes to network settings. Also, check if Airplane Mode is enabled via the laptop's hardware buttons, as this takes precedence over software commands.

How do I find out the exact name of my WiFi interface if it is not "Wireless Network"?

Use the command netsh interface show interfaceThe "Interface Name" column will contain the exact name that should be used in quotation marks in subsequent commands. It could be, for example, "Wi-Fi 2" or "Local Area Connection 3."

Will the netsh winsock reset command reset my WiFi passwords?

No, the Winsock reset command itself does not delete saved WiFi profiles and passwords. However, the command netsh wlan delete profile (if you used it) deletes profiles. A regular stack reset and service restart preserves your security settings.

Why does WiFi turn off again immediately after turning it on via cmd?

This is a sign of a driver conflict or a power saving feature. Windows may automatically disable the adapter if it detects it is unstable. Try updating the driver from the laptop manufacturer's website rather than through Windows Device Manager.