It's common to need to connect a new device to a network but have forgotten the password for your current Wi-Fi connection. Fortunately, the operating system Windows 10 Stores the security keys for all networks you've ever connected to in a secure vault. This allows you to easily restore access without having to reset your router or find your ISP contract.
The fastest and most reliable way to extract this information is to use command lineUnlike the graphical interface, console commands allow you to not only view the current password but also list all saved profiles, which is especially useful for system administrators. Below, we'll cover the process of restoring access to your network in detail.
It is important to note that you will need administrator rights to perform these steps. Without the appropriate privileges, the system blocks access to critical security data, so make sure your account has the required level of access before you begin.
Getting Started with the Command Line
The first step is to launch the terminal in administrator mode. This is mandatory, as accessing system password vaults requires elevated security privileges. A standard console launch will prevent you from executing key extraction commands, and you'll receive an access error message.
To do this, press the key combination Win + X and select the item Windows PowerShell (Administrator) or Command Prompt (Administrator)In newer versions of Windows 10, PowerShell may be replaced by Windows Terminal, which is also suitable for our task. An alternative way is to enter cmd in the search, right-click and select "Run as administrator".
Once the console window opens, you will see a command prompt, usually containing the path to the system folder. Make sure the window title contains the word "Administrator", which confirms that you have the necessary rights. If this word isn't present, close the window and repeat the procedure, paying attention to the startup mode selection.
View a list of saved Wi-Fi networks
Before requesting a specific password, you need to know the exact network profile name stored in the system. Network names can often contain hidden characters or differ from the visible SSID, especially if you've connected to networks with the same name in different locations.
Enter the following command and press Enter:
netsh wlan show profiles
The system will display a list of all profiles, divided into two categories: user profiles and group profiles. We are interested in the section User profiles, which lists all the networks this user has connected to. Find the desired name (SSID) in the list and remember its exact spelling, including case.
If the list is too long, you can scroll or copy the text from the console clipboard (right-click the window title → Edit → Copy). This will help you avoid mistakes when entering the network name in the next step.
Obtaining the password for a specific network
Once the profile name is defined, you can request the security key to be displayed. The command requires the profile name and a parameter that allows the key to be displayed in plaintext. Without this parameter, the system will hide the password with asterisks for security purposes.
Enter the command, replacing Your_network_name to the real name obtained in the previous step:
netsh wlan show profile name="Your_Network_Name" key=clear
Please note that if the network name contains spaces, it must be enclosed in quotation marks. Otherwise, the console will treat part of the name as a separate argument and generate a syntax error. This is a common mistake made by newcomers when working with cmd.
In the report that opens, find the section Security parameters (Security settings). The field we are interested in is called Key content (Key Content). The value to the right of it is the password you're looking for for your Wi-Fi network.
What should I do if the "Key Content" field is empty?
If the Key Content field is empty, this means the profile was saved without a password (open network) or the data was corrupted. If the network is secure, this may indicate an error in the Windows registry, and it's best to delete the profile and recreate it.
Analysis of connection security parameters
Team show profile Provides not only the password but also detailed technical information about the connection. This is useful for diagnosing connection issues or checking the type of encryption used by the router. Knowing these parameters helps understand why some older devices may not be able to see your network.
In the report, pay attention to the following parameters:
- 🔒 Encryption: Indicates the protocol used (usually WPA2-Personal or WPA3), which is important for compatibility.
- 📡 Radio type: Shows the standard (802.11ac, 802.11n) that affects the data transfer rate.
- 🔗 Connection mode: Determines whether the network operates in infrastructure or ad-hoc mode.
- 🆔 BSSID: The unique MAC address of the access point you last connected to.
This data is especially important when setting up corporate networks or troubleshooting IP address conflicts. For example, if you notice that an outdated encryption protocol is being used WEP, this is a signal of low security of your network, and the password should be changed and the router reconfigured to WPA2/WPA3.
Deleting and Managing Wi-Fi Profiles
The command line allows you to not only view but also manage saved profiles. If you've changed the password on your router, but Windows continues to try to connect with the old password, you should delete the profile. This will force the system to request a new key the next time you try to connect.
To delete a profile, use the command:
netsh wlan delete profile name="Your_Network_Name"
After executing the command, the system will confirm the deletion. When attempting to connect to this network, Windows will prompt you for the password again. This is an effective solution when a device "sees" the network but is unable to connect due to security keys being out of sync.
⚠️ Important: Deleting a profile is instant and cannot be restored via the Recycle Bin. Be careful when entering the network name to avoid accidentally deleting an important business or home connection.
☑️ Check before deleting your profile
Comparison of password retrieval methods
There are several ways to find a Wi-Fi password in Windows 10, and the method you choose depends on your skills and the current situation. The graphical interface is more intuitive, but the command line offers more control and scripting capabilities.
The table below provides a comparison of the main methods:
| Method | Complexity | Speed | Requirements |
|---|---|---|---|
| Via CMD (netsh) | Average | High | Administrator rights |
| Through network settings | Low | Average | Access to the current PC |
| QR code (Windows 11/10) | Low | High | Camera on another device |
| Third-party software | Low | High | Installing programs |
Usage cmd This is especially effective when the graphical interface is unstable or when you need to quickly copy a password on a device without a screen (for example, via a remote connection). Furthermore, this method is universal and works on all Windows builds, although interfaces may vary.
Possible errors and their solutions
When running commands, users may encounter various errors. The most common one is "The network was not found in the list of profiles on this computer." This means the network name was entered incorrectly, with a case error or extra spaces.
An "Access Denied" error may also occur if the console is not running as an administrator. In this case, close the window and restart it with elevated privileges. Sometimes antivirus software may block attempts to programmatically retrieve saved passwords, considering this suspicious activity.
⚠️ Note: The command prompt interface and command syntax may vary slightly depending on your Windows 10 version and service pack installed. If the command fails, check that your OS is up to date in Settings → Update & Security.
If the problems persist, try resetting the network settings with the command netsh winsock reset and restart your computer. This will reset your network components to factory settings, which often resolves issues with profiles displaying.
Is it possible to recover a password if Windows is reinstalled?
No, a clean Windows installation clears the password storage. In this case, the only solutions are the sticker on the router, knowledge of the password by other users, or a physical reset of the router using the reset button.
Security measures when working with passwords
Once you have access to passwords, it's important to remember to keep this data secure. Passwords displayed in the console may be visible in the command history or clipboard. After using them, it's recommended to clear the command history to prevent other users of this PC from accessing this information.
To clear the current session history, simply close the console window. For a deeper cleanup, you can use the command doskey /cl, although it only clears the current session. A more reliable way is to disable PowerShell or CMD history storage via Group Policy if you're a system administrator.
Never share screenshots of the open "Key Contents" with third parties or publish them online. Knowing your password and network name, an attacker could access your traffic or local resources.
Is it possible to find out the Wi-Fi password if I'm not connected to the network right now?
Yes, team netsh wlan show profile Works with saved profiles. If you've ever connected to this network and Windows has saved the profile, you'll be able to see the password even if Wi-Fi is currently off or you're out of range of the router.
What should I do if the command returns a password in the form of incomprehensible characters?
This may occur if the console encoding does not match the password encoding (for example, the password contains special characters or non-Latin letters). Try changing the console encoding with the command chcp 65001 (UTF-8) before making the password request.
Does this method work on Windows 7 or 8?
Yes, command syntax netsh wlan It is almost identical in Windows 7, 8, 10, and 11. The only difference may be in the way the console is launched as an administrator, but the command itself and the parameters remain the same.
How do I copy a password from the command line if I can't use a mouse?
In older versions of the console, text was selected by clicking, and copying was done by pressing Enter. In modern Windows Terminal or PowerShell, you can simply press Ctrl + C after selection or use the standard combination Ctrl + Shift + C to copy the selected fragment.