How to find your Wi-Fi password using CMD: methods and commands

It's quite common to need to connect a new device to a wireless network but lose or forget the password. Router owners often change complex password combinations to protect traffic but forget to write them down. Fortunately, the operating system Windows stores data about previously connected networks in a special profile that can be easily read.

Accessing stored credentials does not require physical access to the router or knowledge of the administrative panel credentials. Built-in tools Microsoft Windows Allows you to extract the security key via console commands. This is a standard administrative feature available in versions of Windows 7 through Windows 11.

Using the command line is the most reliable method, requiring no third-party software. Below, we'll explain in detail how to generate a query to the system and retrieve the desired information in plaintext. This method works even if you're not in a network coverage area, as long as your computer has been connected to one.

Prepare the command prompt and run it as administrator

Before entering technical commands, you need to obtain the appropriate access rights. The operating system restricts viewing network settings for security reasons, so a normal console launch may not yield results. You will need to run Command Prompt with increased privileges.

There are several ways to open the desired tool. The fastest is to press a key combination. Win + R and enter cmdHowever, for administrative rights, it's best to use search. Click the Start button, start typing "Command Prompt," and select "Run as administrator" from the list that appears.

After opening the black console window, you will see the path to the system folder, for example, C:\Windows\system32>This means the system is ready to accept instructions. If you don't run the console as an administrator, the command may return an "Access Denied" error or simply not display hidden fields.

  • 🔹 Click Win + X and select "Windows PowerShell (Admin)" or "Terminal (Admin)".
  • 🔹 Enter cmd In the search box on the taskbar, right-click and select Run as administrator.
  • 🔹 Use hotkeys Win + R, enter cmd and press Ctrl + Shift + Enter.

⚠️ Warning: When using the console as an administrator, be careful when entering commands. Incorrect instructions may change system network settings, which will temporarily interrupt your internet connection.

The command line interface may seem intimidating to beginners, but it provides direct access to Netsh — a powerful network configuration tool. This module is responsible for managing wireless local area network (WLAN) profiles. Once you've verified that the window is running correctly, you can begin analyzing available profiles.

View a list of saved Wi-Fi networks

The first step in the data recovery process is identifying the profiles stored in the computer's memory. The system remembers every network you've ever connected to, assigning it a name (SSID). To view the full list, use a specific query syntax.

Enter the following command into the console: netsh wlan show profilesAfter pressing Enter, the system will display a list of all saved profiles. They will be divided into two categories: user profiles (those you created yourself) and system profiles. We are interested in the "User Profiles" section.

netsh wlan show profiles

In the list that appears, find the name of your network. It should match the name displayed in the list of available connections on your router or smartphone. If the network is called "HomeWiFi," remember this name for the next step. If there are many networks, the list may be long, so review the output carefully.

  • 📡 The command shows only those networks to which the device has connected at least once.
  • 📡 If the desired network is not on the list, it means that the computer has never been connected to it, and you won’t be able to find out the password using this method.
  • 📡 Network names are case-sensitive if they contain Cyrillic or special characters.

Sometimes, a profile may be deleted by the user or cleared during a network reset. In this case, the command will return a message stating that no profiles were found. It's also worth considering that on corporate networks, access to this information may be blocked by security policies. Active Directory.

📊 Where do you usually store your Wi-Fi passwords?
In my head (I remember one)
In a notebook/on paper
In the password manager
On the router sticker
I don't remember, I always lose it

Displaying a password in clear text

Once the network name is set correctly, you can request the security key to be displayed. By default, the system hides the password, displaying asterisks or dots. To change the display format and see the text, you need to add a special parameter. key=clear to the profile request.

The command syntax is as follows: netsh wlan show profile name="Network_Name" key=clearPlease note that if the network name contains spaces, it must be enclosed in quotation marks. This is critical, otherwise the command will not execute correctly.

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

As a result, you'll receive a wealth of technical information: encryption type, radio type, channel, and much more. We're interested in the "Security settings" section. Inside, find the "Key Content" line. The value next to this line is your password.

In some cases, the field may be empty. This occurs if the computer is connected to the network via corporate authentication (802.1x) or if the profile was imported without saving the key. For home networks WPA2-Personal This method works almost always without fail.

Export all profiles to XML for detailed analysis

For those who prefer working with files or want to keep a backup of all their network settings, there's an export option. The command line allows you to export the configuration of each profile to a separate XML file, which can be opened in any text editor, such as Notepad++ or standard Notepad.

Use the export command: netsh wlan export profile key=clear folder="C:\WifiBackups"This instruction will create a folder at the specified path and save files with profile names there. Attribute key=clear is also important here - it ensures that passwords are written to the file in clear text, not encrypted.

Command parameter Function Description Mandatory
name="ProfileName" Specifies the name of a specific profile to export. No (exports everything)
key=clear Stores the password in readable XML format. Yes (to view password)
folder="path" Path to the folder where files are saved No (will save to current)
interface="Wi-Fi" Interface name for export No (if there is one adapter)

After creating the files, navigate to the specified directory. The files will have the extension .xmlOpen the desired file and find the tag <keyMaterial>The text inside this tag is your wireless network password. This method is convenient because it allows you to quickly find data without scrolling through long text in the console.

⚠️ Warning: XML files containing cleartext passwords pose a security risk. Do not send them via email and delete them immediately after use.

Resetting and deleting network profiles

Knowing how to manage profiles involves not only reading them but also deleting them. This can be useful if you've changed the router password, but your computer is trying to connect with old, invalid credentials, causing connection errors. Clearing old profiles resolves the conflict issue.

To delete a specific profile, use the command: netsh wlan delete profile name="Network_Name"If you want to delete all saved profiles at once (for example, when preparing a computer for sale or after reinstalling drivers), you can use the command netsh wlan delete profile name=* i=Wi-Fi.

netsh wlan delete profile name="OldNetwork" i="Wi-Fi"

Parameter i indicates the interface name. On most laptops and PCs with a single wireless adapter, it's simply called "Wi-Fi" or "Wireless Network." You can find out the exact interface name with the command netsh interface show interface.

  • 🗑️ Deleting a profile does not delete the network card drivers.
  • 🗑️ After deleting, you will need to re-enter the password the next time you connect.
  • 🗑️ Deleting system profiles may require additional permissions or be blocked.

This feature is especially useful for diagnosing connection issues. If your computer "sees" the network but can't obtain an IP address or constantly displays "Unable to connect," a complete reset of network settings by deleting profiles often helps restore normal operation.

☑️ Diagnosing Wi-Fi problems

Completed: 0 / 4

Common errors and troubleshooting when working with CMD

Despite the simplicity of the method, users often encounter errors when entering commands. The most common problem is a syntax error due to incorrect use of quotation marks or spaces. Windows strictly adheres to syntax rules, and any deviation results in execution failure.

If you see the message "The wireless network profile is not found in this system," make sure the profile name is entered exactly as it appears in the list. Incorrect case or an extra space at the end of the name will cause an error. Also, make sure the console is running as an administrator.

Another common error is related to console encoding. If your network name contains Cyrillic characters and the console is running in OEM encoding, the command may not recognize the name. In this case, you can try switching the encoding with the command chcp 65001 (UTF-8) before entering the query.

⚠️ Note: Command line interfaces may differ slightly in different language versions of Windows. If the command doesn't work, try using the English names of the parameters (e.g., name instead of Name), even if the system is Russified.

It's also worth remembering that antivirus software or corporate security policies may block the execution of Netsh scripts. If you're working on an office computer, access to these functions may be restricted by the system administrator.

What to do if the "netsh" command is not recognized?

If the system reports that the netsh command is not an internal or external command, check your system variables. Typically, the path to netsh (C:\Windows\System32) is already added to your PATH. If it isn't, you can run the command by specifying the full path: C:\Windows\System32\netsh wlan show profiles.

FAQ: Frequently Asked Questions

Is it possible to find out my neighbors' Wi-Fi password using CMD?

No, that's not possible. The command line only allows access to profiles already saved on your computer. To find out someone else's network password, you need physical access to a device already connected to it or know the router's administrator password.

Does this method work on Windows 10 and Windows 11?

Yes, team netsh wlan is standard for all modern versions of Windows, starting with Vista. The interface and syntax remain unchanged, so the instructions are applicable to any current Microsoft operating system.

What should I do if the "Key Content" field is empty?

This means that the network doesn't use an explicit password, or that the enterprise authentication method is used, where access is granted via a certificate or domain login/password. This is rare for home networks and may indicate a corrupted profile.

Is it safe to store passwords in XML files?

Storing passwords in plaintext XML files (key=clear) is unsafe if unauthorized persons have access to the computer. Anyone can open the file and see the password. It is recommended to delete such files immediately after use.