Retrieving a saved Wi-Fi password on a Windows computer is a common need—whether you’ve forgotten your own network key, need to reconnect a new device, or are helping a friend recover access to their home router. The Command Prompt (CMD) offers a quick, built-in way to view Wi-Fi passwords that are already stored on your PC, without installing third-party software. This guide explains how to get Wi-Fi password with CMD safely and legally, focusing only on networks you own or have explicit permission to access. You’ll learn the exact commands, what they do, and how to interpret the results—along with important ethical and security considerations.
What You Need Before You Start
Before using CMD to recover a Wi-Fi password, make sure you meet these prerequisites:
- You are using a Windows PC (Windows 7, 8, 10, or 11) that has previously connected to the target Wi-Fi network.
- You have administrator rights on that computer. Opening Command Prompt as a standard user may limit access to certain network details.
- The Wi-Fi profile is still saved on the device. If the network was never connected or the profile was deleted, CMD cannot retrieve the password.
- You have legal authorization to access the network. This method is intended for your own home or office network, or for a network whose owner has given you permission.
If you’re trying to access a neighbor’s Wi-Fi or a public network without authorization, stop here. Unauthorized access to computer networks is illegal in most countries and violates ethical norms. The steps below are strictly for legitimate password recovery.
Step-by-Step: How to Get Wi-Fi Password with CMD
Step 1: Open Command Prompt as Administrator
Press the Windows key, type cmd, then right-click Command Prompt and select Run as administrator. A User Account Control prompt may appear—click Yes. Running CMD with elevated privileges ensures the netsh commands can read the saved wireless profile details.
Step 2: List All Saved Wi-Fi Profiles
In the Command Prompt window, type the following command and press Enter:
netsh wlan show profiles
This command displays every Wi-Fi network name (SSID) that your computer has connected to and saved. Because of that, look through the list and identify the network whose password you want to recover. Note the exact profile name—it’s usually the same as the Wi-Fi network name, but it may include spaces or special characters Most people skip this — try not to..
Step 3: Show the Password for a Specific Profile
Once you have the profile name, use this command, replacing YourNetworkName with the exact name from the previous step:
netsh wlan show profile name="YourNetworkName" key=clear
Press Enter. The output will include a section called Security settings. And look for the line labeled Key Content. The value next to it is the Wi-Fi password in plain text. If you see “Key Content : Present” but no actual password, it means the password is not stored or you lack the necessary permissions—double-check that you’re running CMD as administrator.
Step 4: (Optional) Export the Profile for Backup
If you need to transfer the Wi-Fi settings to another computer, you can export the profile to an XML file:
netsh wlan export profile name="YourNetworkName" folder=C:\WiFiBackup key=clear
This creates an XML file containing the network configuration, including the password. Keep this file secure—anyone with access to it can see the password.
How Does This Work? The Science Behind the Command
Windows stores Wi-Fi profiles—including the network name, security type, and encryption key—in a protected system location. The key=clear parameter tells netsh to display the encryption key in plain text rather than hiding it. When you connect to a Wi-Fi network and choose to “remember” it, Windows saves the credentials so you don’t have to re-enter them. Consider this: the netsh (Network Shell) command-line utility is a legitimate administrative tool that interacts with these stored profiles. This is why administrator rights are required: the password is sensitive information, and Windows restricts access to it Most people skip this — try not to. Nothing fancy..
It’s important to understand that this method does not “crack” or “hack” a Wi-Fi password. So it simply reveals a password that is already saved on your own device. On top of that, if the network was never connected or the profile was removed, CMD has nothing to show. Similarly, if you’re trying to retrieve a password for a network you’ve never joined, this method will not work—and attempting to bypass that limitation would be unethical and likely illegal.
Alternative: Using the Graphical Interface
If you prefer not to use CMD, Windows also offers a graphical way to view saved Wi-Fi passwords:
- Open Settings > Network & Internet > Wi-Fi.
- Click Manage known networks.
- Select the network and click Properties.
- Scroll down to Network security key and click Show.
You’ll need to confirm your administrator credentials. This achieves the same result as the CMD method and may be more comfortable for less technical users Simple as that..
Important Security and Ethical Considerations
- Only use this on your own network or with explicit permission. Accessing someone else’s Wi-Fi password without authorization is a violation of privacy and computer misuse laws.
- Keep your own passwords secure. If you’ve exported a Wi-Fi profile or shared your password, consider changing your router’s password afterward.
- Use a password manager. Instead of relying on saved profiles, store your Wi-Fi passwords in a reputable password manager for easy, secure retrieval.
- Be cautious with public computers. If you use a shared or public PC, avoid saving Wi-Fi passwords or clear the profiles after use.
Frequently Asked Questions (FAQ)
Q: Can I get a Wi-Fi password with CMD if I’ve never connected to that network? A: No. CMD only reveals passwords for networks that are already saved on your computer. It cannot retrieve passwords for networks you haven’t joined Worth keeping that in mind..
Q: Why does the command show “Key Content : Present” but no password? A: This usually means you’re not running Command Prompt as administrator, or the profile was saved without the password (e.g., via a group policy). Try reopening CMD with admin rights.
Q: Is using CMD to view Wi-Fi passwords legal? A: Yes, for your own network or with the owner’s permission. Without authorization, it may be illegal and is always unethical Surprisingly effective..
Q: Can I use this method on a Mac or Linux? A: No. This guide is specific to Windows. Mac and Linux have different commands and tools for viewing saved Wi-Fi passwords.
Q: What if I forgot my Wi-Fi password and CMD doesn’t show it? A: You may need to reset your router to factory settings and set a new password, or contact your internet service provider for help.
Conclusion
Knowing how to get Wi-Fi password with CMD is a practical skill for any Windows user who needs to recover a saved network key That alone is useful..
Whether you're reconnecting a new device, helping a guest join your network, or simply documenting your home setup, the netsh wlan commands give you a fast, built-in way to retrieve the information without installing any third-party software. Because the method relies entirely on Windows' native tools, it works across most modern versions of the operating system and requires no additional downloads Nothing fancy..
The key things to remember are simple: run Command Prompt as an administrator, target the correct network profile, and look for the Key Content line under security settings to find the actual password. If you'd rather avoid the command line altogether, the Settings app offers a point-and-click alternative that produces the same result Simple, but easy to overlook..
Not obvious, but once you see it — you'll see it everywhere.
Just as important is using this knowledge responsibly. And these commands are meant for recovering access to networks you own or are authorized to manage. Handled with that principle in mind, knowing how to view saved Wi-Fi credentials is a small but genuinely useful part of managing your own devices and networks The details matter here..