Deleting Wi-Fi Profiles via Command Prompt (CMD) in Windows

Many users are familiar with the situation when a computer or laptop refuses to connect to a router after changing the password or network configuration. The Windows operating system often attempts to automatically reconnect using saved, but now incorrect, data, leading to an endless loop of errors. Standard graphical interface tools allow you to manage connections, but sometimes they don't provide full control over hidden settings or function incorrectly due to software glitches.

The most effective and reliable solution in such cases is to use command line (CMD). This tool provides direct access to the WLAN AutoConfig service, allowing you to forcefully remove network profiles that can't be removed through system settings. Understanding the principles of console commands gives administrators and advanced users complete control over network adapters.

In this article, we'll cover in detail the process of clearing the list of known networks, diagnosing driver issues, and methods for completely resetting network settings. You'll learn how to safely delete a specific profile or clear the entire list of saved connections using built-in Windows utilities without installing third-party software.

Why delete Wi-Fi profiles through the console?

The main reason why you might need to delete a Wi-Fi network via CMD is due to configuration conflicts. When you change router settings, such as the encryption type from WPA2 to WPA3, or simply change the password, Windows may continue to try to connect using the old ones. credentialsThe system does not always correctly process the password update request, preferring to use the cached profile, which makes connection impossible.

Using the command line allows you to bypass the graphical interface, which can be corrupted or blocked by group policies. Additionally, CMD allows you to perform batch operations, such as deleting all profiles at once or selecting a specific network by its exact name, which is especially useful in corporate environments or when working with a large number of access points. It's also a great way to resolve issues where the Settings interface freezes or doesn't display the "Forget" button.

⚠️ Attention: Before making changes to system configurations via the command line, ensure you have administrator rights. Incorrectly deleting system profiles may temporarily disable your device's access to the local network.

Another important aspect is safetyIf you used Wi-Fi at a cafe or airport, that network's profile remains on your device. Attackers can use SSID (network name) cloning to automatically connect your laptop to a malicious access point posing as a legitimate one. Regularly clearing your list of known networks reduces this risk.

Launch Command Prompt with Administrator Privileges

Any operations related to managing network adapters and profiles require elevated privileges. Launching the console normally will not allow you to make changes to the system registry or WLAN configuration. There are several ways to open this tool, and the method you choose depends on your operating system version and personal preference.

The fastest way is to use the search in the Start menu. Type in your query cmd or Command line, then select "Run as administrator" from the search results. Alternatively, you can press the key combination Win + X and select "Windows PowerShell (Admin)" or "Terminal (Admin)" in newer versions of Windows 10 and 11. PowerShell is fully compatible with classic CMD commands.

You can also use the Run dialog box, which is called by typing Win + R. Enter the command cmd, but before pressing Enter or clicking on "OK" use the combination Ctrl + Shift + EnterThis will instantly launch the console with administrator privileges, eliminating any additional mouse clicks. Once launched, you'll see a window with a black background where you can enter commands.

View saved Wi-Fi network profiles

Before deleting any data, you need to understand which profiles are stored in the operating system's memory. Windows stores information about all networks to which it has ever successfully connected. To obtain this list, use the utility netsh (Network Shell), which is a powerful tool for configuring and monitoring networks.

Enter the following command in the window that opens and press Enter:

netsh wlan show profiles

Once completed, you'll see the "User Profiles" section, which will list the full list of network names (SSIDs). This name is a key identifier that you'll need for further steps. Please note that names may contain spaces and special characters, so be careful with case and spelling when entering deletion commands.

To get more detailed information about a specific network, including the security type, channel name, and even the password (if stored in plaintext), you can expand the command. Add the profile name in quotation marks:

netsh wlan show profile name="Network_Name" key=clear

This command is useful for diagnosticsIt will show which encryption algorithm is used (for example, CCMP or TKIP) and whether it matches the current router settings. If you see a security mismatch, deleting the profile is a mandatory step before reconnecting.

📊 How often do you change your Wi-Fi passwords?
Once a month
Once every six months
Once a year
I never change

Deleting a specific network profile

Deleting a specific profile is the most common connection troubleshooting task. The command syntax is fairly simple, but it requires precision in spelling the network name. If the name contains spaces, it must be enclosed in double quotation marks; otherwise, the command line will treat part of the name as a separate argument and return an error.

The command format is as follows:

netsh wlan delete profile name="Your_Network_Name"

For example, if your network is called Home_WiFi_5G, the command will be: netsh wlan delete profile name="Home_WiFi_5G"After pressing Enter, the system will confirm the successful operation with the message: "Profile 'Network_Name' has been removed from the 'Wireless Network' interface." If the network is not found, a corresponding notification will appear, which may indicate either a spelling error or that the profile has already been deleted.

It's important to note that deleting a profile via CMD is instant and doesn't require a device reboot. However, if the laptop is currently connected to the network being deleted, the connection will be lost. This is normal behavior, as it removes the configuration necessary for maintaining the connection.

☑️ Check before deletion

Completed: 0 / 4

Deleting all Wi-Fi profiles at once

In situations where a complete network reset is required, such as before selling a laptop or after a major network stack failure, it's more convenient to delete all saved profiles at once. This will restore the network adapter to a clean slate, forcing Windows to rescan the airwaves and prompt for passwords for all access points.

To do this, use a command with a wildcard symbol (asterisk), which substitutes any values:

netsh wlan delete profile name= i=

Here is the parameter i=* indicates that the operation should be performed on all wireless network interfaces. If you have multiple Wi-Fi adapters (for example, built-in and USB), the command will affect them all. The system will ask for confirmation or perform the wipe immediately, depending on your Windows version and security settings.

⚠️ Attention: This command will delete All Known networks, including home, work, and public ones. You'll have to re-enter passwords for each device you want to connect to later. Use this method with caution.

An alternative bulk deletion method that works on some versions of Windows without using the asterisk for interfaces is as follows:

netsh wlan delete profile name=* 

After completing this procedure, it is recommended to restart your computer. This will allow the WLAN AutoConfig service to completely recreate the configuration files and flush the DNS cache, which often resolves issues with slow network searches or dropped internet.

Resetting network settings and troubleshooting problems

If deleting profiles doesn't help and connection issues persist, the issue may lie with deeper settings in the Windows network stack. The command line allows you to reset TCP/IP protocols and flush the DNS cache, which often resolves IP address conflicts and routing errors.

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

netsh int ip reset

netsh winsock reset

ipconfig /flushdns

ipconfig /release

ipconfig /renew

Team netsh winsock reset resets the Winsock directory to its default state, which corrects corrupted socket settings that may be blocking network communication. The command ipconfig /flushdns Clears the local DNS cache, eliminating problems with opening websites when the IP addresses of domains have changed, but the computer remembers the old ones.

For users who prefer to see a summary of the adapter's status before resetting, the following command is useful: netsh wlan show interfacesIt will show the current connection status, signal strength, radio type (802.11ac/n/ax), and the presence of data transmission errors.

What to do if commands are not executed?

If you receive an "Access Denied" error even when running the program as an administrator, check your antivirus. Some third-party security solutions block changes to network settings. Temporarily disable protection or add an exception.

Summary table of basic commands

For ease of use, we recommend saving the list of basic commands to a text file or printing it. Below is a table organizing the discussed functions of the netsh Wi-Fi management utility.

Team Description of action Necessary rights
netsh wlan show profiles Displays a list of all saved profiles. User
netsh wlan show profile name="Name" key=clear Shows profile details and password in plain text Administrator
netsh wlan delete profile name="Name" Deletes a specific network profile Administrator
netsh wlan delete profile name=* Deletes all Wi-Fi profiles on the system. Administrator
netsh wlan show interfaces Shows the status and characteristics of the connected adapter. User

Using these commands allows you to effectively manage wireless connections at a level inaccessible to a standard GUI user. Mastering these tools significantly simplifies the administration of home and office networks.

Alternative methods and management via PowerShell

While the classic command prompt (cmd.exe) remains the standard, PowerShell is becoming increasingly popular in modern versions of Windows (8.1, 10, 11). It has a more powerful syntax and an object-oriented approach. To delete a Wi-Fi profile in PowerShell, you can use the same commands. netsh, since they are systemic, or use native cmdlets.

However, for tasks specifically related to deleting Wi-Fi profiles, there is no built-in cmdlet in PowerShell that would be simpler. netsh, not at the moment. Therefore, the PowerShell + netsh combination remains optimal. You can launch PowerShell and enter:

netsh wlan delete profile name="Network_Name"

The advantage of PowerShell is its automation capabilities. You can create a script (.ps1) that will automatically delete profiles with certain words in the name (for example, those containing "Guest" or "Temp"), which is useful for IT professionals setting up multiple computers.

⚠️ Attention: Interfaces and available commands may vary slightly depending on the Windows version and security updates. Always check the command syntax in the official Microsoft documentation if standard methods don't work.

What should I do if the command says "Profile not found"?

This means the network name is entered incorrectly. Check the list of profiles with the command netsh wlan show profiles again. Pay attention to spaces, letter case, and special characters. The name in the command must match the name in the list exactly. It's also possible that the profile has already been deleted.

Is it possible to restore a deleted profile?

No, the delete command permanently erases the configuration from the Windows registry. However, since the profile only contains connection settings (name, security type, password), you can simply reconnect to this network by entering the password. The system will create a new profile from scratch.

Is it safe to delete system network profiles?

Deleting user Wi-Fi network profiles is safe. However, you should not delete profiles associated with critical corporate certificates or networks required for domain operation unless you are certain of the consequences. For home use, deleting any Wi-Fi profile is safe.

Why did the network immediately reappear after deletion?

If the network reappeared immediately after deletion, it may be broadcast from another device (for example, a phone's internet hotspot) that automatically connects to your PC, or third-party Wi-Fi management software is running on the system and is restoring the settings. It could also be the Windows "Connect to open hotspots" feature.