Many users are familiar with the situation of urgently needing to connect a new device to a wireless network but losing or forgetting the password. Often, the router is already configured, the computer connects automatically to the internet, but it's impossible to remember the password for the smartphone or tablet. In such cases, reinstalling the operating system or resetting the router to factory settings is not necessary.
operating system Windows Stores profiles of all networks your computer has ever connected to in a secure vault. Even if you don't remember your security key, it's stored in the system and accessible for viewing. The most reliable and fastest way to retrieve this information is using the built-in command line utility.
This method does not require installation of third-party software and works on all modern versions of Windows, starting from Windows 7 and ending with the current one Windows 11You don't need superuser rights to view already saved profiles, but some security configurations may require administrator rights to run the console.
How Windows Profile Storage Works
When you first enter a password to connect to a wireless network, the operating system stores it in a special registry. This process is necessary for automatic authentication the next time the device comes within range of the access point. The data is stored encrypted, but the system provides a legal tool to decrypt it upon request.
The service responsible for managing wireless connections in Windows is WLAN AutoConfigIt interacts with network adapter drivers and processes connection requests. We send requests directly to this service via the command line, receiving full profile parameters in response, including the security key.
It's important to understand that you can only view the password for the network the computer has previously connected to. If you've never connected to the router you're using from this PC, you won't be able to find the password remotely through the console. However, for most scenarios where you simply need to remember a forgotten password, this method is ideal.
⚠️ Warning: The Command Prompt is a powerful tool. While viewing Wi-Fi profiles is safe, avoid entering commands whose purpose you don't understand, especially those that involve deleting data or modifying system files.
Using the console is preferable to third-party programs, as it eliminates the risk of downloading malware. Built-in tools Microsoft ensure that you see exactly the data stored in the system, without distortion or hidden information collection functions.
Launch Command Prompt with Administrator Privileges
To get started, you need to launch the command line interface. There are several ways to do this in modern versions of Windows, but for proper execution of network commands, it's best to use administrator mode. This will provide full access to all network management functions.
The fastest way is to use the search in the Start menu. Enter the abbreviation in the search box. cmd or full name Command lineOnce the system finds the application, right-click the icon and select "Run as administrator." Confirm the action in the User Account Control window.
An alternative option is to use the Run dialog box. Press the keyboard shortcut Win + R, in the window that appears, enter the command:
cmd
After pressing Enter A black console window will open. If you haven't run the program as administrator via the context menu, some commands may be unavailable, although standard user rights with system access are usually sufficient for viewing passwords.
☑️ Preparing to work with the console
Viewing a list of saved networks
Before searching for a specific password, you need to know the exact name of the network profile saved in the system. The profile name may differ from the wireless network name (SSID), especially if you've manually renamed connections or connected to networks with the same name in different locations.
To list all saved profiles, use the command:
netsh wlan show profiles
In the window that opens, you'll see the "User Profiles" section. Below it, you'll see a list of all networks. Find the name you need in the list. This Profile Name will be needed for the next step. If you have many networks, the list may be long, so review it carefully.
The table below shows the main parameters that the system displays when displaying a list of profiles:
| Parameter | Description | Meaning for the user |
|---|---|---|
| All user profiles | General list of networks | Here we look for the name of the required network |
| Device profile | System networks | Usually don't require a password |
| Profile name | Network SSID | Key parameter for the request |
| Interface | Network adapter | Computer Wi-Fi adapter |
If the list is empty, the computer has never connected to any wireless network, or the profile was previously deleted. In this case, it is impossible to recover the password from this computer.
Obtaining the password for a specific network
Once you know the exact profile name, you can request its detailed settings. The security key is hidden by default for security reasons, so you need to add a special key to the command. The command syntax is as follows:
netsh wlan show profile name="NETWORK_NAME" key=clear
Please note that instead of NETWORK_NAME You need to substitute the exact name of your profile that you found in the previous step. If the name contains spaces, it must be enclosed in quotation marks. Parameter key=clear instructs system to display the security key in plain text.
After entering the command and pressing Enter The system will display a large block of text. You need to find the "Security settings" section. Inside this section, look for the line "Key Content." The value next to this line is your Wi-Fi password.
What should I do if the network name contains special characters?
If your profile name contains quotation marks or other special characters, try using single quotes instead of double ones, or escaping the characters with a backslash. However, in 99% of cases, double quotes around the entire name are sufficient.
If the "Key Contents" line displays empty or an error message, it may indicate that the profile is corrupted or the network is using a corporate authentication method where the password is not stored in clear text on the client.
Analysis of connection security parameters
The profile output command displays not only the password but also a variety of other technical details. The "Security Settings" section contains information about the encryption type and authentication method. This is useful for manually configuring new devices.
The most common types of encryption you may see are:
- 🔒 WPA2-Personal — a modern standard that provides reliable protection for your home network.
- 🔐 WPA3-Personal — the latest security protocol implemented in the latest generation of routers.
- ⚠️ WEP — an outdated and insecure method, the password for which is best changed to a more secure one.
The type of data encryption is also indicated here, usually it is AES or TKIPFor stable and fast network operation, it is recommended to use a bundle WPA2/WPA3 with encryption AESIf you see that your network is using outdated protocols, it's time to consider updating your router settings.
In this same section, you can see the radio signal type (for example, 802.11n or 802.11ac), which helps you understand the frequency and speed of the connection. However, the main focus is on the key string, which is now available to you.
Deleting and managing profiles via the console
The command line allows you to not only view but also manage profiles. If you want to delete an old profile for a network you no longer connect to (for example, a neighbor's or office network), you can do so with a single command. This helps clean up the list and speed up network selection.
To delete a profile, use the command:
netsh wlan delete profile name="NETWORK_NAME"
After running this command, the profile will be completely removed from the Windows registry. Your computer will no longer attempt to automatically connect to this network. If you need to access it again, you'll have to re-enter the password.
It's also possible to export the profile to an XML file. This can be useful for system administrators who need to deploy identical network settings to multiple computers. However, the password in such a file may be encrypted unless special export keys are used.
⚠️ Warning: Deleting the current connection profile will disconnect your internet connection. Make sure you have an alternate network connection or know the password to re-enter.
Manage profiles via netsh This is especially convenient in automation scripts. For example, when initially setting up a fleet of laptops in an office, you can prepare a script in advance that will delete test profiles and leave only corporate ones.
Common mistakes and how to solve them
When working with the command line, users often encounter syntax errors. The most common one is an incorrectly specified profile name. The system is case-sensitive and space-sensitive. If the name contains spaces, quotation marks are required.
Another possible issue is the message "WLAN AutoConfig service is not running." This means that the system service responsible for Wi-Fi is disabled. To resolve this, open the service (command services.msc), find "WLAN AutoConfig Service" and start it.
It's also possible that the command runs, but the key isn't displayed. This often happens if you're trying to view the password for a network the computer is currently connected to, but access rights are restricted by group policies. In this case, try running the console as an administrator.
If all else fails, check your antivirus. Some security solutions can block attempts by programs (including the console) to access sensitive network data. Temporarily disable your antivirus to test this hypothesis.
Alternative ways to restore access
If for some reason using the command line is impossible or inconvenient, there are other methods. In Windows 10 and 11, you can view the password through the network settings graphical interface, although this requires more clicks. You can also log in to the router's web interface if you're connected via cable or know the administrator password.
The router's web interface (usually at 192.168.0.1 or 192.168.1.1) allows you to not only view but also change your Wi-Fi password. This is the best option if you want to secure your network by changing the key to a more complex one. Default passwords are often simple and vulnerable.
Another option is to use a QR code. Windows 10/11 has a "Share" feature in the Wi-Fi settings. The system generates a QR code that, when scanned with a smartphone, can be connected to the network without manually entering a password. This is a modern and convenient alternative to older methods.
The choice of method depends on your preferences and current situation. However, knowledge of console commands remains a fundamental skill for any advanced PC user.
Is it possible to find out the Wi-Fi password if the computer is not connected to it?
No, the command prompt only shows saved profiles. If the computer has never connected to this network and hasn't saved the password, it's impossible to find it using the command prompt. You'll need physical access to the router or other device where the password is saved.
Is it safe to use the netsh wlan show profiles command?
Yes, this is a standard Windows operating system command designed for network diagnostics and management. It doesn't make any changes to the system or transmit data to the internet, making it completely safe to use.
What should I do if the key output contains asterisks or empty space instead of a password?
This means you don't have sufficient permissions to view the key. Restart the command prompt as administrator (right-click the cmd icon -> Run as administrator) and try the command again.
Does this method work on Windows 11?
Yes, this method is fully compatible with Windows 11, as well as Windows 10, 8, and 7. The network management commands via netsh are basic and do not change in new OS versions.