Many users are familiar with the situation of needing to connect a new device to a wireless network, but the password is forgotten or lost. Fortunately, the operating system Windows Stores data about previously connected access points in a dedicated secure storage area. Retrieving this information doesn't require third-party software or a factory reset.
The most reliable and fastest way to restore access is to use the built-in command line utility. This method works on all current OS versions, from Windows 7 to Windows 11. You only need a basic understanding of commands and administrator privileges to execute system queries.
In this article, we'll walk you through a step-by-step process that will allow you to see your hidden security key. We'll cover not only the standard syntax, but also potential errors, as well as the nuances of working with network profiles in the system registry and WLAN database.
Launch Command Prompt with Administrator Privileges
To execute system commands related to network settings, the terminal's normal operating mode is insufficient. The operating system blocks access to critical security settings to prevent malware interference. Therefore, the first step should always be to launch the console with elevated privileges.
There are several ways to open the tool you need. The fastest is to use the system search. Click the magnifying glass icon on the taskbar or press the key Win + S, enter the abbreviation CMD or full name Command lineIn the search results, a "Run as administrator" button will appear on the right. Be sure to select it.
⚠️ Warning: If you attempt to run network commands in normal mode, the system will return an access error. Make sure the console window title is set to "Administrator: Command Prompt."
An alternative option for advanced users is to use hotkeys. Click Win + Xto open the quick links menu and select "Windows PowerShell (Administrator)" or "Windows Terminal." The command syntax in these shells is identical to the classic CMD, so you can use whichever interface you prefer.
Once the window opens, you'll see a black or dark blue background with a blinking cursor. This is where you'll enter commands. Don't close the window until you've completed all operations, as the standard console's input history is limited, and retyping long commands can take time.
Viewing a list of saved Wi-Fi profiles
Before looking for a specific password, it's important to understand how the system identifies known networks. Windows assigns each connection a unique profile, which usually has the same name as SSID (network name) visible in the list of available connections.
To display a complete list of all networks ever stored on this computer, use the command netsh wlan show profilesEnter it carefully, including spaces between words. The result will be a list of all profiles, divided into "User Profiles" and "Group Policy Profiles" groups.
The list will show the names of all networks to which this laptop or PC has ever connected. If the desired network isn't listed, it means the computer never saved its settings, and finding the password this way won't work—you'll need physical access to the router or other device where the network is active.
Please ensure the profile name is spelled exactly. If the network name contains spaces or special characters, you will need to account for them when working with this profile. The system is case-sensitive, but for Wi-Fi profile names this is often not critical; it's best to copy the name exactly.
Command to display the password of a specific network
Once you've determined the desired profile name, you can proceed to extracting the security key. This uses a more advanced version of the command, which requires specifying a specific network name. The syntax is as follows: netsh wlan show profile name="Network_Name" key=clear.
The key point here is the parameter key=clearThis parameter tells the system to display the security field contents in plain text, rather than hiding them with asterisks. Without this parameter, the command will only display general connection specifications.
netsh wlan show profile name="HomeWiFi" key=clear
Instead of HomeWiFi You must substitute your actual profile name. If the network name contains spaces, such as "My Home Network," be sure to enclose it in double quotation marks, as shown in the example. Ignoring the quotation marks will result in a syntax error, and the command will fail.
Perform the input by pressing the key EnterThe system will process the request and provide a detailed report. You'll need to find the "Security settings" section. Inside this section, look for the "Key Content" line. The value displayed next to this field is the password you're looking for.
☑️ Check before entering a command
Analysis of security parameters and keys
The command's report contains a wealth of technical information that can be confusing to an inexperienced user. In addition to the password, it displays the encryption type, authentication method, and connection status. It's important to be able to navigate this data to understand the status of your network.
Please pay attention to the "Encryption Type" (Cipher) field. In modern networks, the standard is AESIf you see the value here TKIP or WEPThis is a sign that your network is using outdated and insecure security protocols. Such networks are easier to hack, and it's recommended to upgrade them in your router settings.
⚠️ Warning: WEP is considered completely obsolete and provides no real data security. If your network uses WEP, an attacker can intercept your traffic within minutes.
The report also indicates the "Security type", which usually corresponds to the standard WPA2-Personal or WPA3-PersonalThis confirms that a passphrase is used for access. If this field says "Open," then the network password is not set, and the key field will not be displayed.
For ease of reference, the main report fields are summarized in the table below. This will help you quickly find the required line in the technical text.
| Parameter (RU) | Parameter (EN) | Meaning |
|---|---|---|
| Profile name | Profile name | Home_WiFi |
| Security type | Security type | WPA2-Personal |
| Encryption | Cipher | AES |
| Key content | Key Content | Your_password |
The "Key Content" string is the target string. Copy the value carefully, avoiding extra spaces at the beginning or end of the string if you plan to enter it manually on another device.
Alternative method via PowerShell
If for some reason the classic command line CMD is not available or you prefer more modern tools, a similar operation can be performed in the environment PowerShellThis method may seem more complicated due to the syntax, but it provides the same capabilities.
In PowerShell, the command to get the profile looks similar, but requires a prefix netsh or using specific NetSecurity module cmdlets. However, the easiest way is to simply use the same command netsh inside the PowerShell window, since this utility is system and available in any shell.
For those who want to use the native capabilities of PowerShell to work with Wi-Fi, there is a command Get-NetConnectionProfile, but it shows the current connection state, not saved passwords. Therefore, for the "remember password" task, the combination netsh remains the most versatile and effective solution regardless of the shell.
Why is PowerShell sometimes more convenient than CMD?
PowerShell supports more complex syntax, object handling, and script automation. However, for one-off tasks like "find a password," the difference in performance and end-user experience is minimal.
PowerShell's main advantage in this context is the ability to copy the entire output of a command to the clipboard with a single keystroke (often this works by selecting it with the mouse and pressing Enter, or by using special terminal settings), which makes it easier to find the desired line in a text editor.
Deleting profiles and managing connections
Knowing the command line is useful not only for obtaining passwords but also for clearing the network list. Over time, the Wi-Fi profile database can grow, including neighbors' networks, public access points in cafes, and old routers. This can create conflicts during automatic connections.
To delete a specific profile, use the command netsh wlan delete profile name="Network_Name"This action will irreversibly delete the saved password and settings for this network. If you connect to it again, the system will prompt you for the security key again.
This feature is especially useful for troubleshooting. If the computer can't connect to the network even though the password is correct, deleting the old profile and creating a new one often resolves driver or IP address conflicts.
⚠️ Caution: Be careful when deleting profiles. Make sure you're deleting the network you no longer need, not the one you're currently connected to. Otherwise, you may lose internet access until you log in again.
To completely clear all saved profiles (the radical method), you can use a loop in PowerShell, but for the average user, it's safer to delete networks one by one through the Manage Known Networks menu in Windows Settings or via the CMD command above.
Common mistakes and how to solve them
When working with the command line, users often encounter common errors. Understanding their causes helps quickly resolve the issue without panic. The most common issue is the message "The network was not found in the list of profiles on this computer."
This means that the name you entered after the parameter name=, does not match any of the saved profiles. Check the list of profiles with the command show profiles Once again. Pay attention to hidden characters, spaces, and case insufficiency. Sometimes users confuse the profile name with the device name (MAC address) or the SSID of the broadcast network if they are different.
The second common error is a lack of administrator rights. If the system responds with "Access Denied" or "Elevation Required," you forgot to run the console as an administrator. Restart the CMD using the context menu or search for it.
It's also possible that the "Key Contents" field is empty or not displayed. This happens if the profile was imported without preserving the security key (for example, through corporate policies) or if you're trying to view the password for a network you connected to a long time ago on a different user account, and the profile wasn't migrated.
Is it possible to find out a Wi-Fi password if the computer has never connected to it?
No, this can't be done via CMD. The command line only works with the local database of saved profiles. If the device has never connected to the network and hasn't saved its settings, the key information simply won't exist in the system. Physical access to the router or another device with an active network is required.
Does this method work on Windows 11?
Yes, absolutely. The mechanism for working with WLAN profiles via the netsh utility hasn't changed for many years and is fully supported in Windows 11, 10, 8, and 7. The interface may look slightly different, but the commands remain identical.
What if the network name contains special characters?
In this case, it is extremely important to enclose the network name in double quotes. For example: netsh wlan show profile name="My#Net!" key=clearIf quotation marks don't help, try copying the network name from the profile list and pasting it into the command to avoid typing errors.
Where are these passwords physically stored?
Passwords are stored in the Windows system registry and in protected configuration files in the folder C:\ProgramData\Microsoft\Wlansvc\Profiles\InterfacesThey are encrypted with a key tied to a specific user account and system, so simply copying the file to another PC and reading the password won't work.
Is it possible to recover the guest network password?
Only if you've ever connected to this guest network from this computer and saved a profile. Guest networks often have temporary passwords or expiration dates, so even if you find an old password in the profile, it may no longer be valid.