The situation of needing to connect a new device to the network, but having forgotten the password and no other device with the saved data is familiar to many. Router owners often change the default security settings, write down complex combinations, and then forget them a month later. Fortunately, the operating system Windows stores access keys to previously used networks in its profile, and they can be retrieved without third-party software.
The most effective and fastest way to recover lost data is to use the built-in command line utility. This method requires no additional software, works on all modern OS versions, and reveals hidden characters in seconds. All you need is access to a computer that is already connected to the desired network or has previously connected to it.
Before diving into the technical details, it's important to understand how it works. The system doesn't store passwords in plaintext on disk as a text file accessible to every user. However, for network authentication, they must be accessible to the system kernel, and the command line provides a legitimate interface for requesting this data from the wireless network manager. This is a standard feature, not a hack.
Preparing the command line for work
Any network interface management operations in Windows require elevated privileges. Running the console in user mode will prevent the system from displaying sensitive data, such as security keys. Therefore, the first step should always be to obtain administrator privileges. This is a standard security procedure that prevents unauthorized access to system settings.
There are several ways to launch the required tool. The fastest is to use the system search. Press the key combination Win + S or click the magnifying glass icon on the taskbar. In the field that appears, enter cmd or Command lineThe desired application will appear in the search results. Right-click the icon and select "Run as administrator." Confirm the action in the User Account Control window.
An alternative option for advanced users is to use the Run menu. Click Win + R, enter cmd, but instead of simply pressing Enter, use the combination Ctrl + Shift + EnterThis will also launch the console with elevated privileges. If you prefer PowerShell, it's also suitable for running these commands, as it supports CMD syntax in basic queries.
⚠️ Warning: Running Command Prompt as administrator gives you extensive privileges. Be careful when entering commands from untrusted sources to avoid damaging system files or network settings.
After a successful launch, a black window with a blinking cursor will open. The interface may seem unfriendly to beginners, but this is where direct communication with the operating system occurs. Make sure the window title says "Administrator: Command Prompt" or the path to the system folder. System32.
Viewing a list of saved Wi-Fi profiles
Before prompting for a specific password, you must ensure that the desired network profile is actually saved in the computer's memory. Windows maintains a log of all connections to which a successful login has ever been made. To display this list, use the command netsh wlan, which controls the wireless local area network settings.
Enter the following command into the console and press Enter:
netsh wlan show profiles
The system will process the request and display a table titled "User Profiles." The "Profile Names" column will list all networks to which this PC has connected. Look for the exact name of your network (SSID). If the list is empty, the computer never connected to Wi-Fi automatically, and this method will not recover the password.
Sometimes the network name may contain spaces or special characters. In this case, you'll need to enclose the name in quotation marks when working with the profile. Also note that the list may include guest networks or neighbors' networks you've connected to in the past. Select only the profile for which you need the password.
If you don't see the desired network in the list, check to see if the profile is hidden. In rare cases, group policy settings may restrict the visibility of profiles for the current user, although this is typically the exception for corporate networks.
Obtaining a security key for a specific network
Once you've verified the profile's existence, you can proceed to extracting the key. The command remains the same, but is supplemented with parameters indicating whether the profile contents should be displayed, including key materialsThe syntax requires the network name to be specified exactly.
Use the following command pattern, replacing Network_Name to the real name of your Wi-Fi:
netsh wlan show profile name="Network_Name" key=clear
Pay attention to the parameter key=clearThis parameter instructs the system to display the key in a readable format. Without this parameter, the system will display general profile information, but the password field will be hidden with asterisks or not displayed at all. If the network name contains spaces, quotation marks are required.
After entering the command, the system will display a large amount of technical information. Scroll down a bit to the "Security settings" section. We're interested in the "Key Content" line. The value next to this line is your password.
What to do if the password is not displayed?
If the "Key Content" line is empty or says "not applicable", it may mean that the network is using an enterprise authentication method (802.1x), where the password is not stored in cleartext but is generated dynamically, or you do not have sufficient permissions to view it.
The table below describes the main parameters you will see in the profile report to help you better understand the command output:
| Parameter | Description | Importance for Wi-Fi |
|---|---|---|
| Profile name | Local save name | Network SSID |
| Connection type | Access method | Wireless |
| Security type | Encryption protocol | WPA2-Personal / WPA3 |
| Key content | Access password | Your password |
Alternative methods via PowerShell
While the classic Command Prompt (CMD) is the most familiar tool, modern versions of Windows, such as Windows 10 And Windows 11, a more powerful tool is increasingly being used: PowerShell. It works with objects and allows you to retrieve the same data, sometimes in a more readable format, although the syntax may differ.
To get the password via PowerShell, you can use the same command netsh, as PowerShell supports legacy commands. However, if you want to use native PowerShell cmdlets, the process is more complex and requires writing a script to decode stored credentials, which is impractical for a one-time operation. Therefore, the PowerShell + netsh combination remains optimal.
Run PowerShell as administrator and enter:
netsh wlan show profile name="Your_Network" key=clear
The result will be identical to the output in CMD. PowerShell's advantage is the ability to copy text: standard mouse selection and copying via Ctrl+C, whereas in classic CMD you sometimes need to enable quick edit mode through the window properties.
⚠️ Note: Operating system interfaces are subject to update. The location of settings or the exact field names in reports may vary slightly depending on the Windows build version and localization.
If you plan to frequently interact with network settings, it might be worth creating your own PowerShell script that automates listing networks and selecting the right one. This will save you time in the future, but requires basic programming knowledge.
☑️ Check before entering a command
Restoring access without administrator rights
A question often arises: is it possible to find out a password if the user does not have administrator rights? Using standard system tools - NoWindows security policy prevents standard users from viewing stored security keys in plain text. This is to protect data when a computer is shared among multiple users.
However, if you have physical access to the router, you can try to find out the password through the device's web interface. To do this, connect to the router (via cable or Wi-Fi, if automatic login is enabled), open a browser, and enter the gateway IP address (often 192.168.0.1 or 192.168.1.1). If you know the login and password for the router's admin panel (often found on a sticker on the bottom), you can see the Wi-Fi key in the wireless network settings.
There are also third party utilities such as WirelessKeyView NirSoft has programs that can display saved keys. However, most of them still require administrator privileges to operate, as they access the same system APIs as the command line. Furthermore, antivirus software often flags such programs as potentially unwanted programs.
In a corporate environment where administrator privileges are strictly limited, the only legal option is to contact the IT department. Attempts to bypass restrictions using exploits or vulnerabilities may violate the organization's security policy.
Common mistakes and their solutions
When running commands, users often encounter error messages. The most common ones are "Network not found" or "One or more arguments are required." This usually indicates a typo in the profile name. In Windows, names are case-sensitive and space-sensitive. Use the profile view command, copy the name exactly, and paste it into the command prompt.
Another common issue is an access denied message, even if the console is running as administrator. This can occur if the profile was created for a different user on the system. In this case, try running the command netsh wlan export profile name="Name" key=clear folder="path_to_folder"This will create an XML file with settings, where the password will be specified in the tag keyMaterial in the open.
If you're using a Russian version of Windows and entering commands using an English keyboard layout (or vice versa), the system will return a syntax error. Make sure the commands netsh, wlan, show, profile, name, key, clear and equal signs = Entered using the English keyboard layout. The network name in quotation marks can be in any language.
It's also worth mentioning the encoding issue. If the network name contains rare characters or emoji, the console may not process the request correctly. In this case, changing the console encoding with the command chcp 65001 before the main query, although for standard Latin and Cyrillic names this is rarely required.
Is it possible to find out someone else's Wi-Fi password?
No, the methods described work ONLY for networks to which your computer has previously connected and saved a profile. It's impossible to legally find out someone else's network password without access to it.
Security measures and password protection
Understanding how easy it is to access your saved password should make you think about the security of your own device. If an attacker gains access to your computer, they can quickly extract keys to all your networks. Therefore, it is important to use account with password to log into Windows and do not leave your computer unattended in an unlocked state.
It's recommended to change your Wi-Fi passwords periodically, especially if you've stopped using the network or suspect someone else has accessed it. Changing your router password will require reconnecting all your devices, but it ensures that any old saved profiles (for example, on a friend's laptop) will no longer work.
Use complex passwords that include mixed-case letters, numbers, and special characters. Simple combinations are easily brute-forced, regardless of how they are stored in the system. Passwords shorter than 8 characters are considered insecure by modern encryption standards. WPA2/WPA3.
What to do if the netsh command doesn't work?
If the team netsh If the device is not recognized, the system files may be corrupted or the WLAN service may be disabled. Check the "WLAN AutoConfig" service in Task Manager. You can also try repairing the system files using the command sfc /scannow.
Where are Wi-Fi profiles stored in the registry?
Profiles are stored in a hidden system folder. C:\ProgramData\Microsoft\Wlansvc\Profiles\InterfacesThe files are in .xml format, but the keys within them are encrypted. Directly editing the registry or files without proper tools will not reveal the password.
Is it possible to recover a password after reinstalling Windows?
No. A clean installation of the operating system deletes all user data, including saved network profiles. If you didn't export the profiles beforehand or don't know the password, it will be impossible to recover them programmatically from the C:\ drive.