It's quite common to need to find a saved password for a wireless network. You might have connected a new laptop or tablet but forgotten the password you entered on your main computer. In the operating system Windows 10 This information is securely hidden from prying eyes for security reasons, but it does not disappear without a trace.
Fortunately, the system's built-in tools allow you to extract this data without using third-party software. The most reliable and fastest way is to use command line (CMD). This method works even when the graphical interface crashes or when you need to access data for a specific network profile.
In this article, we'll take a detailed look at the steps to recover a forgotten password. We'll cover using the utility. netsh, which is the standard network management tool in Windows. You don't need to be a programmer; just follow the instructions and enter commands carefully.
Getting Started with the Command Line
Before you can enter commands, you must obtain the appropriate access rights. Operating system Windows 10 Blocks changes to network settings for standard users, so the console must be launched as an administrator. This is a basic security requirement; ignoring it will result in errors when executing queries.
There are several ways to open the required tool. You can use the system search, type "cmd" or "Command Prompt," and then select the "Run as administrator" option. Alternatively, right-click the "Start" button and select Windows PowerShell (Administrator) or "Terminal", since they are fully compatible with the commands we need.
After the black window opens, you'll see a blinking cursor. This is where you'll enter commands to interact with the network adapter. Make sure the computer you're using has previously successfully connected to the WiFi network whose password you want to retrieve. If the device has never connected to this router, you won't be able to recover the password this way.
⚠️ Caution: When working in the command line, precision is essential. A single character error can cause the command to fail or, in rare cases, cause unexpected system behavior. Check your syntax carefully before pressing Enter.
View a list of saved WiFi profiles
The first step in the data recovery process is to obtain a complete list of all wireless networks your computer has ever connected to. Windows stores these profiles in a special database, and the utility netsh Knows how to work with it. This will allow you to remember the exact network name (SSID) if there were many.
To get the list, you need to enter the following command:
netsh wlan show profiles
After pressing Enter, the system will display a report containing a section called "User Profiles." Below this section, all network names are listed. If you see the desired network in this list, the password for it is saved in the system and can be retrieved. If the network isn't listed, the computer has "forgotten" it, and you won't be able to recover the password from this device.
Sometimes the list can be very long, especially in offices or crowded areas. In this case, you can use scrolling or export the list to a text file for easier analysis. This is especially useful if you're looking for a network with a similar name but can't remember the exact name.
How to save a list of networks to a file?
Enter the command: netsh wlan show profiles > C:\wifi_list.txt. The file will appear in the root of the C drive, making it easy to find the name you need.
Obtaining the password for a specific network
Once you've decided on the network name (SSID), the most important step begins. We need to request the system to display the security key in plaintext. By default, Windows hides password characters, replacing them with dots or asterisks, but a special command line switch allows you to bypass this restriction.
The command has the following structure: first, the utility is specified, followed by the profile type, network name, and a keyword to display the password. The syntax is as follows:
netsh wlan show profile name="NETWORK_NAME" key=clear
Please note that if your network name contains spaces, quotation marks are required. For example, for the network Home WiFi the command will look like this netsh wlan show profile name="Home WiFi" key=clearIf you don't include quotation marks, the system will return a syntax error.
In the output report, find the "Security settings" section. Inside this section, look for the "Key Content" line. The value next to this line is the WiFi password you're looking for.
Network security parameters analysis
The report generated by the command line contains not only the password but also a wealth of other technical information. Understanding this data can be useful for diagnosing connection issues or assessing the reliability of your wireless network. Let's review the main items you'll see in the console window.
The top section of the report shows the profile name and network type. Network type is usually designated as "Private" or "Public." Below that is a section with connection information, which shows the network status and infrastructure type. But what interests us most is the security section.
In the security section you will find the following important settings:
- 🔒 Authentication (Authentication): Shows the authentication method, most often WPA2-Personal or WPA3-Personal.
- 🔑 Cipher (Cipher): Specifies the data encryption algorithm, the modern standard is CCMP (AES).
- 📶 Security key (Security Key): This is where the "Key Content" line with your password is hidden.
If the "Key Content" field displays a blank value or a message stating that the key is not visible, this may indicate that your account does not have sufficient privileges, even if the console is running as an administrator. This can also occur in corporate networks that use complex server-based authentication.
⚠️ Note: Command prompt interfaces may vary slightly depending on your Windows 10 version and language packs installed. Field names may be in English or Russian, but the command structure remains the same.
Using PowerShell to Manage WiFi
While the classic command line (CMD) is a tried and tested tool, modern versions Windows 10 PowerShell is becoming increasingly popular. It's a more powerful tool that also supports commands. netsh, but also has its own modules for working with networks. However, for our specific task, the syntax remains virtually identical.
Launching PowerShell is similar to CMD: via the search bar or the Start menu with administrator privileges. The window will have a different background color (usually blue), but the operation is the same. You can copy the command from the previous section and paste it into PowerShell by right-clicking.
PowerShell's advantage is its more flexible processing of results if you plan to automate the process or write the results to a complex log file using scripts. For a one-time password view, the standard CMD capabilities are sufficient, but knowing an alternative is useful.
Creating a script to quickly retrieve a password
If you frequently need to recover passwords or are a system administrator, it makes sense to create a simple script. This is a file with the extension .bat or .cmd, which contains the necessary commands. Running this file will instantly generate a list of networks and their passwords without manual entry.
To create a script, open Notepad and enter the following code:
@echo offecho List of WiFi profiles:
netsh wlan show profiles
echo.
echo Enter your profile name to get your password:
set /p profile=
netsh wlan show profile name="%profile%" key=clear
pause
Save the file with a name like, get_wifi_pass.batWhen run, this script will first display all available profiles, then prompt you to enter the desired network name and immediately display the password information. This saves time and reduces the risk of typos when entering long commands.
However, remember that such scripts contain sensitive information about your network. Do not share them with third parties and store them in a secure location. Anyone who runs this file on your computer will be able to obtain passwords for all saved networks.
☑️ Script security
Netsh WiFi Command Table
Windows offers a whole set of commands to help you manage wireless networks. Below is a table of the most useful ones, which will help you not only find the password but also manage connections.
| Team | Description of action | Example of use |
|---|---|---|
show profiles |
Shows a list of all saved networks. | netsh wlan show profiles |
show profile name=... key=clear |
Displays profile details and password | netsh wlan show profile name="Home" key=clear |
delete profile name=... |
Deletes a network profile from memory. | netsh wlan delete profile name="OldWiFi" |
export profile name=... folder=... |
Exports a profile to an XML file. | netsh wlan export profile name="Home" folder=C:\ |
Using the delete command (delete profile) can be useful if you want to completely "forget" a network and clear the connection list. This often helps resolve issues where the computer can't connect to the router after changing the password.
Export command (export profile) creates an XML file containing all network settings, including the password (encrypted). This file can be transferred to another computer and imported to automatically connect it to the WiFi network without manually entering the password.
Possible errors and their solutions
When running commands, users may encounter various errors. The most common one is "Network not found in profile." This means the network name in the command doesn't match the name in the database. Check for spaces, capitalization, and special characters.
Another common issue is lack of access rights. Even if you run the console as an administrator, some corporate security policies may block viewing of keys. In this case, the system will report that the parameter is not visible.
It's also worth keeping in mind that these commands only work with networks saved on the current device. You can't find out the password for a neighbor's network if your computer has never connected to it. This is a fundamental security limitation of Windows.
⚠️ Note: If you use third-party antiviruses or firewalls, they may block access to network settings via the command line. If you experience persistent errors, try temporarily disabling the protection.
What to do if the password is not displayed?
Make sure you're using the 'key=clear' keyword. If that doesn't help, check if your account is an administrator. In rare cases, updating your WiFi adapter drivers can help.
FAQ: Frequently Asked Questions
Is it possible to find out the WiFi password if the computer is not currently connected to the network?
Yes, you can. The commands work with saved profiles in Windows memory. If your computer has ever successfully connected to this network and saved the settings, you'll be able to see the password, even if the router is currently turned off or out of range.
Does this method work on Windows 7 and Windows 11?
Yes, it is a utility. netsh is present in all modern versions of Windows, starting with Vista. The command syntax remains identical for Windows 7, 8, 10, and 11, so the instructions are universal for all Microsoft operating systems.
Is it safe to store passwords on the command line?
The command itself is secure, as it simply displays already saved data. However, taking a screenshot of a password-protected window or saving the command output to an unprotected text file creates a risk of data leakage. Always delete files containing passwords after use.
What if the network name contains special characters?
If the network name (SSID) contains spaces or special characters, be sure to enclose the name in double quotation marks. For example: name="My Home #1"Without quotes, the command line will treat part of the name as a separate argument and return an error.
Is it possible to recover a password using a graphical interface?
Yes, you can do this through "Network & Internet Settings" -> "Network and Sharing Center" -> "Wireless Network Properties" -> "Security" tab. There, you need to check the "Show characters as you type" box. But the CMD method is often faster and more convenient.