It's quite common to need to connect a new device to a wireless network, but the password is forgotten or written down in an inaccessible place. Fortunately, the operating system Windows Stores access keys to all previously connected networks in a dedicated vault. This allows you to recover lost data without having to physically access the router or ask your neighbors for the key.
There are several ways to extract this information, but using command line is the most universal and reliable method. It works even when the system's graphical interface is malfunctioning or requires additional steps. In this article, we'll detail the steps to restore access.
To perform the manipulations described below, you will need rights administratorWithout them, the Windows security system will not allow you to view saved encryption keys. Make sure you are logged in with an account with the appropriate privileges before entering commands.
Preparing the command line for work
The first step is to launch a system utility for entering text commands. In modern versions of Windows, such as Windows 10 And Windows 11, this can be done in several ways. The fastest is to press a key combination Win + R, enter cmd and press Enter, but to get the necessary rights it is better to use the search.
Click the Start button and start typing "cmd" or "Command Prompt." The application will appear in the search results. To run it with administrator rights, right-click the icon and select the appropriate option from the menu or click "Run as administrator" in the right pane.
⚠️ Warning: Running the command prompt without administrator privileges will result in an error when attempting to query network profiles. The system will display a message stating that you do not have permission to manage network services.
After successful launch, a black window with a blinking cursor will appear. This is the interface for entering instructions to the operating system. The interface is now ready to accept commands for working with network profiles.
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. These names can often differ from the actual access point name (SSID), especially if you connected to public networks or manually renamed profiles.
To get a complete list of all networks your computer has ever connected to, use the list profiles command. Enter the following text into the terminal window and press Enter:
netsh wlan show profiles
The system will process your request and display a list under the heading "User Profiles." This list will display all saved connections. Find the network you need in the list and remember its exact name, as you'll need it in the next step.
If the list is very long, you can scroll through it or go straight to searching for a specific name if you remember it. However, a visual inspection of the list often helps you remember the exact name a network is saved under in the system.
Obtaining a password in clear text
Once the profile name is defined, you can request the security key to be displayed. This is done using a more detailed command that requires the profile name and a special parameter for displaying the key.
Enter the following construction, replacing Network_name with the name of your network from the previous step. Note that if the name contains spaces, it must be enclosed in quotation marks:
netsh wlan show profile name="Network_Name" key=clear
After executing the command, the system will display a comprehensive block of technical information about the selected profile. Find the "Security settings" section. Within this block, the line you're looking for will be called "Key Content."
⚠️ Note: If the "Key Content" field displays a blank value or a dash, this means the password is not saved in the system or the current user does not have permission to read it.
The value next to this item is your password. Copy it or write it down to use when connecting other devices, such as smartphones, tablets, or printers.
Alternative method via PowerShell
If for some reason the classic command line is unavailable or you prefer more modern tools, you can use the shell PowerShellIt has more advanced capabilities, but for our purposes the syntax will be almost identical.
Launch PowerShell as administrator using the Start menu search. Enter the same command to view profiles as before:
netsh wlan show profiles
Next, to get the password, use the same request logic with the parameter key=clearAlthough PowerShell supports its own modules for working with networks, using netsh within it often turns out to be faster and easier for one-off tasks.
Why might the password not be displayed?
The password may not be displayed if the network profile is corrupted, deleted by an antivirus program, or if you are using a Windows guest account without administrator rights. The key will also not be visible if the network uses enterprise 802.1x encryption, which requires certificates.
An advantage of PowerShell is the ability to copy command output directly to the clipboard using a keyboard shortcut, making it easy to save long lists of networks.
Network security parameters analysis
The profile information command contains not only the password but also important information about the encryption type and connection security. Understanding these parameters will help diagnose connection issues with new devices.
In the command output, note the following fields:
- 🔒 TypeAuthentication: Shows the authentication method, usually WPA2-Personal or WPA3.
- 🔐 Encryption: Specifies the encryption algorithm, such as CCMP or TKIP.
- 📡 Radio type: Tells you whether your network is running 802.11ac, 802.11n, or later.
Knowing the encryption type is important because older devices may not support modern security standards such as WPA3If your device doesn't connect, checking these settings in your PC profile will help you determine compatibility.
| Parameter | Description | Recommended value |
|---|---|---|
| Authentication | Authentication method | WPA2-Personal |
| Cipher | Data encryption algorithm | CCMP |
| Security key | Availability of a security key | Present |
| Key Content | The password itself (visible only with key=clear) | Your password |
This data can also be useful when setting up a new router to recreate identical network settings and ensure seamless device switching.
Deleting and managing profiles
The command line allows you to not only view but also delete old or unnecessary network profiles. This is useful if the list of connections has become too large or if you've changed the router password and an old profile is interfering with your connection.
To delete a profile, use the command delete profileThe syntax is as follows:
netsh wlan delete profile name="Network_Name"
After executing this command, the profile will be completely deleted from the computer's memory. The next time you try to connect to this network, the system will prompt you for the password again.
☑️ Check before deleting your profile
Clearing the profile list may also resolve some connection issues if the system is trying to automatically connect to a network with incorrect or outdated security settings.
Common mistakes and their solutions
When working with network commands, users may encounter various errors. One of the most common is "The WLAN AutoConfig service is not running." This means that the system service responsible for wireless networks is disabled.
To solve the problem, you need to open the service manager by entering services.msc in the Run window (Win + R). Find the service in the list. WLAN AutoConfig, launch it and set the startup type to "Automatic".
⚠️ Note: Service interfaces and names may vary slightly depending on your Windows version and installed security updates. If the command doesn't work, check the documentation for your OS version to ensure it's up-to-date.
Another possible error is related to incorrect command syntax, especially with quotation marks. Make sure you're using standard double quotes, not the "herringbone" quotation marks that your text editor sometimes automatically inserts.
If the system reports that the profile is not found, double-check the name in the profile list. Letter case is usually unimportant, but spaces and special characters must match exactly.
Security measures for storing passwords
While viewing passwords is convenient, it also poses a risk if an attacker gains access to your computer. Anyone with administrator rights can easily extract the keys for all networks.
To improve security, we recommend using complex, hard-to-guess passwords and updating them regularly. It's also a good idea to limit who has administrator rights on your PC.
Don't save passwords in text files on your desktop. Instead, use your browser's built-in password manager or a dedicated secure storage service.
Is it possible to find out the WiFi password if I'm not connected to the network right now?
Yes, you can. The command line accesses the Windows profile store, which stores information about all the networks you've previously connected to. You don't need to be online at the time; the profile must be logged in.
Does this method work on Windows 7, 8, 10 and 11?
Yes, team netsh wlan is standard for all modern versions of Windows, starting with Windows 7. The command syntax has remained unchanged for many years.
What should I do if the Key Content field is empty?
This means you ran the command prompt without administrator privileges. Close the window, right-click "Command Prompt" and select "Run as administrator," then re-run the command.
Is it possible to hack someone else's WiFi this way?
No, this method only allows you to view passwords that have already been saved on your computer after a successful connection. It's impossible to find the password for a network you've never connected to using the command line.
How to copy password from black command prompt window?
In modern versions of Windows, it is enough to simply select the text with the mouse and click Ctrl + CIn older versions, you need to right-click on the window title, select "Edit" → "Select", highlight the text, and press Enter.