Situations where you need to restore access to a wireless network arise regularly: you bought a new laptop, connected a smart speaker, or simply forgot the complex security key you once created. Luckily, the operating system Windows Stores data about previously used connections in a secure registry, and it can be retrieved without third-party software. Using the command line is the most reliable and fastest method, and it works even when the system's graphical interface crashes or is hidden.
Unlike cracking programs, using built-in Microsoft utilities is in a safe and legal way Recover your own data. You won't need to download dubious executable files, risking infecting your computer with viruses. All the necessary tools are already built into the system, and the process takes just a couple of minutes if you know the exact syntax and sequence of actions.
This method is universal and suitable for both modern versions Windows 10 and 11, and for older builds like Windows 7 or 8.1. The main requirement is administrator rights on the device you plan to use to perform the request. Below, we'll detail each step of the process, possible errors and troubleshooting steps, and answer frequently asked questions from beginners.
Preparing the environment and launching the console
Before entering commands, you must open the command prompt with elevated privileges. Launching it from the Start menu may not provide the necessary privileges to read system security profiles. The fastest way is to press a key combination. Win + R, enter cmd and press Ctrl + Shift + Enter, which will force the console to run as administrator.
An alternative option is to use the system search. Click the magnifying glass icon on the taskbar, type "command", and select "Run as administrator" from the results on the right. If you are using Windows 10 or 11, you can also right-click on the "Start" button and select "Windows PowerShell (Admin)" or "Terminal", as they are fully compatible with classic CMD commands.
⚠️ Important: If the black or blue box doesn't prompt you to confirm your rights (UAC) after launching the window, your account doesn't have administrator rights. In this case, you won't be able to retrieve the saved password using standard methods without logging in to the PC owner's profile.
Make sure that the path is indicated in the title of the window that opens. C:\Windows\system32\cmd.exe and the cursor on the left is blinking. This indicates that the system is ready to receive instructionsThe environment is now fully prepared for working with network configurations.
Viewing a list of saved networks
The first step in the data recovery process is to obtain a complete list of wireless networks to which your computer has ever connected. This is done using the utility netsh, which controls the shell's network settings. Enter the following command and press Enter:
netsh wlan show profiles
Once completed, you'll see a block of information titled "User Profiles." It will list all the SSIDs (network names) the system has remembered. These could be neighbors' networks you've previously connected to, guest access points, or home routers with different names.
If the list is empty, it means one of two things: either this computer has never connected to WiFi, or the profile was previously deleted. If the desired network is not listed, recovering the password via CMD is impossible, as the system simply has no place to store it.
Why may some networks not display correctly?
Sometimes network names containing special characters or Cyrillic characters in older encodings may be displayed as question marks or a series of characters. This is due to console encoding settings, but it won't interfere with the commands if you know the exact profile name.
Obtaining a security key for a specific network
Knowing the exact profile name, you can request the display of all its parameters, including the security key. The command requires the profile name after the keyword. nameThe syntax is as follows:
netsh wlan show profile name="Network_Name" key=clear
Please note that if your network name contains spaces, it must be enclosed in quotation marks. Parameter key=clear This flag is critical: without it, the system will only display the encrypted key hash, which is useless for connecting new devices. This flag instructs the system to decrypt and display the password in cleartext.
After running the command, scroll down to the "Security Settings" section. We're interested in the "Key Content" line. The value to the right of the colon is your password. Copy it carefully, observing the capitalization of the letters.
Analysis of security and encryption parameters
In addition to the password itself, the command output netsh Provides valuable information about the type of encryption and security mode used. This helps you understand how secure your network is. In the "Security Settings" section, pay attention to the "Encryption Type" and "Security Type" lines.
The modern standard is the protocol WPA2-Personal or its newer version WPA3If you see an outdated standard WEP or simply WPA (without the "2") is a sign of poor security. Such networks are easily hacked even with simple mobile apps, and in this case, changing your password as soon as possible is recommended.
You can also see the authentication type here. For home networks, this is typically "WPA2-Personal," which uses a pre-shared key (PSK). In corporate environments, you might see "WPA2-Enterprise," which requires a domain login and password, and viewing the authentication via CMD may only reveal profile settings, not the user's personal credentials.
| Parameter | Description | Recommended value |
|---|---|---|
| Security type | Connection security protocol | WPA2-Personal / WPA3 |
| Encryption | Data encoding algorithm | AES |
| Key type | Stored password format | ASCII |
| Connection status | Current adapter status | Connected |
Resetting a forgotten password and reconnecting
Sometimes, when a router has been reset to factory settings, the old password saved in Windows is no longer valid. In this case, the computer will continually attempt to connect with incorrect credentials, returning an error. To fix this, delete the old profile.
Use the delete profile command, substituting the name of your network:
netsh wlan delete profile name="Network_Name"
After the command is successfully executed, the system will confirm the deletion. Now, when you try to connect to this network, Windows will prompt you for the password again, as if you were connecting for the first time. This is the ideal way to fix key synchronization errors between your device and the access point.
⚠️ Warning: Deleting a profile permanently erases the saved password from this computer. Make sure you know the current router key or have physical access to it to reset it before executing this command.
If you don't remember the new password after resetting your router, check the sticker on the bottom of the device—the factory default key is often listed there. If you changed it previously and forgot, you'll have to connect your computer to the router via a LAN cable to set it up again.
Common mistakes and how to solve them
When working with the command line, users often encounter common problems. The most common error is "Network not found in profile." This occurs if the network name is misspelled, spaces are missing, or quotation marks are not used. Check the spelling using the view all profiles command.
Another common issue is lack of access rights. If the system displays "Access Denied," it means the console is not running as an administrator. Close the window and restart CMD with elevated privileges. Errors can also occur if the "WLAN AutoConfiguration Manager" service is stopped.
☑️ Diagnosing CMD problems
In rare cases, antivirus software may block attempts to download security keys, viewing this as suspicious activity. If you're confident your actions are safe, try temporarily disabling your security software or adding an exception for Windows system utilities.
Questions and Answers
Is it possible to find out the WiFi password if the computer is not currently connected to this network?
Yes, it's possible. The command line accesses saved profiles in the Windows registry. If you've ever successfully connected to this network and haven't deleted the profile, you can retrieve the password at any time, even without an active internet connection or router.
Does this method work on Windows 7 and older versions?
Yes, it is a utility. netsh This method has been present in Windows since Vista. However, the interface and the exact wording of the system responses may vary slightly. This method doesn't work in very old versions (like XP), as they used a different key storage mechanism.
What should I do if the "Key Content" field displays asterisks or dots?
This means that the command was executed without a parameter. key=clearBe sure to add this part to the end of the query string. Also, make sure you enter the command in administrator mode, otherwise the system may hide sensitive data.
Is it possible to find out the password for someone else's network this way?
No. This method only allows you to see passwords that have already been entered by you or another user of this computer and saved in the system. It's impossible to find the password for a network to which the device has never connected using CMD.