It's quite common to need to connect a new device to your home network but have forgotten or lost the Wi-Fi password. Fortunately, the Windows operating system remembers access keys for networks it has previously successfully connected to. This allows you to recover a lost password without having to reset your router or contact your ISP.
The most reliable and fastest way to extract this information is to use the command line, also known as command shell or CMDThis method works on all modern OS versions, from Windows 7 to the latest builds of Windows 10 and 11, without requiring any third-party software.
In this guide, we'll detail the steps you need to take to access your saved credentials. You'll learn how to use the system's built-in utilities to manage wireless networks and safely restore internet access.
Why use the command line to restore access?
Many users are accustomed to searching for passwords in the router's graphical settings interface or in the connection properties, which often requires an already connected device or access to the web interface. However, command line Provides direct access to system data storage, bypassing complex menus. This is especially useful if the network graphical interface is malfunctioning or hidden.
Using the console allows you not only to see the key, but also to manage network profiles: delete old ones, create new ones, or export settings. Netsh — is a powerful tool built into Windows that interacts with network configurations at a deep level.
⚠️ Note: Editing or fully displaying network profiles may require administrator privileges. Ensure your account has the appropriate privileges before proceeding.
The main advantage of this method is its versatility. Regardless of the manufacturer of your Wi-Fi adapter, be it Realtek, Intel or Qualcomm Atheros — the commands remain the same. This eliminates the need to search for specific drivers or utilities for each specific device.
Preparing to work with the console
Before entering commands, you must properly launch the terminal. Launching it through the search bar may not provide sufficient permissions to read some system security settings. Therefore, it's important to open command line on behalf of the administrator.
To do this, press the key combination Win + X and select "Windows Terminal (Admin)" or "Command Prompt (Admin)". In older versions of the OS, you can find cmd via the Start menu, right-click and select "Run as administrator".
After launching a window with a black background, you'll see a system prompt to enter commands. The system is now ready to interact with the network interface.
☑️ Check before you start
Viewing a list of saved networks
The first step in the recovery process is to obtain a list of all Wi-Fi networks whose profiles are saved on your computer. Even if you're not currently connected to the router, but have previously connected, the profile will be present in the database.
To display the list, use the command netsh wlan show profilesIt displays all user profiles stored in the current session. The system will respond with a list titled "User Profiles."
Please note the exact name of your network (SSID). It must be entered correctly in subsequent commands, taking into account capitalization and spaces. If the name contains spaces, it must be enclosed in quotation marks.
What to do if the network is not on the list?
If the desired network doesn't appear in the profile list, it means the computer never connected to it automatically, or the profile was deleted. In this case, recovering the password via CMD is impossible; you'll need access to the router or other device where you're logged in.
In some cases, the list may be empty if you previously cleared your network settings or reinstalled the system without saving profiles. In this case, the only options are physical access to the router or using a mobile phone with QR code scanning functionality (if the phone is already connected).
Command to display the password of a specific network
Once you've decided on a network name, you need to request detailed profile information. We're interested in the field where the security key is stored in plaintext. For this, use the extended command with a parameter. key=clear.
The command syntax is as follows:
netsh wlan show profile name="Your_Network_Name" key=clear
Replace Your_Network_Name to the actual name of your Wi-Fi. For example, if the network is called Home_WiFi, the command will be: netsh wlan show profile name="Home_WiFi" key=clearIf the name contains spaces, quotation marks are required.
In the command output, find the "Security settings" section. We're interested in the "Key Content" line. The value to the right of this line is the password you're looking for.
| Parameter | Description | Where to look in the output |
|---|---|---|
| Profile name | Wi-Fi network name | User profile |
| Security type | Encryption protocol (WPA2, WPA3) | Security parameters |
| Security key | The network password itself | Key content |
| State | Connection status | State |
It is important to note that the parameter key=clear This is critically important. Without it, the system will display the profile but hide the password itself, replacing it with asterisks or dashes. This is a standard Windows security measure.
Understanding security parameters and encryption types
In the profile information window, you can see not only the password but also the type of encryption used. This information is useful for diagnosing connection issues. Modern standards, such as WPA2-Personal And WPA3, provide a high level of protection.
If you see an outdated encryption type, such as WEP or WPA (without the 2), this is a signal that your network security is at risk. Such protocols are easily hacked even by inexperienced attackers using automated scripts.
The "Security Settings" section also specifies the "auth_type" (Authentication). For home networks, this is usually WPA2-Personal. If it is indicated here Open, which means the network is not password protected and anyone can connect to it.
⚠️ Note: Encryption types and security standards may be updated by router manufacturers. Always check the official specifications of your equipment to ensure it supports the latest security protocols.
Understanding these parameters not only helps you restore access but also assess the security of your home infrastructure. If the password is displayed but the encryption type is listed as "None" or "Unknown," the profile may be corrupted.
Alternative methods and profile management
The command line allows you to not only view but also delete unnecessary profiles. This is useful if you've changed the router password and your computer is trying to connect with the old password and returns an error. The command to delete is as follows: netsh wlan delete profile name="Network_Name".
There's also a graphical alternative to obtaining the password if you have access to another already connected computer or smartphone. In Windows 10 and 11, you can view the password via "Network & Internet Settings" -> "Advanced Network Settings" -> "Advanced Sharing Settings," but CMD remains the fastest tool for IT professionals.
For advanced users, there is the option to export all profiles to XML files. Team netsh wlan export profile key=clear folder="C:\Wifi" Saves all profiles with open passwords to the specified folder. This is convenient for backing up settings before reinstalling the system.
Security measures and data protection
Once you've gained access to your passwords, it's important to remember security. Storing passwords in plaintext in system profiles is a potential risk. If an attacker with administrator rights gains access to your computer, they can easily extract keys to every network you've ever connected to.
It's recommended to change your Wi-Fi passwords periodically, especially if you suspect unauthorized access to your network. A complex password containing mixed-case letters, numbers, and special characters will make hackers' lives much more difficult.
Do not transfer files with exported profiles (.xml) to third parties and do not store them in unencrypted cloud storage. Such files contain the password.