Smart Systems for Home

Plain how-to guides for smart home, security and home Wi-Fi

Saved Wi-Fi Password in CMD? How to Retrieve It

· 6 min read · Home Networking

In this article
  1. Background: How Windows Stores Wi-Fi Credentials
  2. How to Retrieve a Saved Wi-Fi Password Using CMD
  3. Common Problems and Troubleshooting
  4. Alternative Methods: PowerShell and GUI
  5. Security and Privacy Considerations
  6. Limitations: What You Can’t Do
  7. Frequently Asked Questions

Yes, you can retrieve a saved Wi-Fi password from Windows using Command Prompt (CMD) — but only if the network profile is stored on your local machine and you have administrative privileges. This method works for networks you've previously connected to on that specific device, not for passwords stored elsewhere or on other devices.

Background: How Windows Stores Wi-Fi Credentials

Windows stores Wi-Fi network profiles — including the SSID (network name), security type (like WPA2-Personal), and the pre-shared key (PSK, i.e., the password) — in the local profile store. These profiles are encrypted using Windows' Data Protection API (DPAPI), which ties the decryption key to your user account. As a result, only the original user who saved the network (or an administrator on that machine) can typically view the password in plaintext using built-in tools like netsh or PowerShell. The data is not stored in plain text in configuration files, but Windows deliberately allows authorized users to export or view it for troubleshooting or recovery purposes.

How to Retrieve a Saved Wi-Fi Password Using CMD

To retrieve a saved Wi-Fi password via Command Prompt, follow these steps precisely:

  1. Open Command Prompt as Administrator: Press Windows + X, then select Command Prompt (Admin) or Windows Terminal (Admin).
  2. Enter the command: netsh wlan show profile name="NetworkName" key=clear, replacing NetworkName with the exact SSID (case-sensitive, and include quotes if the name has spaces).
  3. Look for the Key Content field under the Security settings section — this is the password.

Example: To find the password for a network named "Home_WiFi", run: netsh wlan show profile name="Home_WiFi" key=clear

The command queries the Windows Wireless Configuration service for the specified profile and reveals the key in clear text because the user account has the necessary decryption rights. Note that this does not work for enterprise networks using 802.1X authentication (e.g., in offices), where credentials are often handled by certificates or smart cards instead of a static password.

Common Problems and Troubleshooting

Several issues may prevent successful password retrieval:

  • Profile not found: The network may have been forgotten, or the SSID was entered differently (e.g., "MyNetwork" vs. "myNetwork"). List all saved profiles with netsh wlan show profiles to verify the exact name.
  • Access denied: You must run CMD as Administrator. Non-administrative accounts cannot view the key content, even if they connected to the network before.
  • Empty Key Content: This occurs if the network uses WEP (deprecated) or enterprise authentication (PEAP, EAP-TLS), where no PSK is stored. For WPA/WPA2-Enterprise, passwords are ephemeral and re-authenticated each session.
  • Spelling or quote errors: SSIDs with special characters or spaces require exact quoting. Typos in the name cause the command to fail.

If CMD fails, try PowerShell instead: (netsh wlan show profiles name="NetworkName" key=clear) | Select-String "Key Content" or use the graphical interface via Network & Internet Settings.

Alternative Methods: PowerShell and GUI

PowerShell offers a more programmatic alternative:

  1. Open PowerShell as Administrator.
  2. Run: netsh wlan show profile name="NetworkName" key=clear | Select-String "Key Content"

Or use this PowerShell one-liner for all networks:

  1. $profiles = netsh wlan show profiles | Select-String "All User Profile"
  2. $profiles | ForEach-Object { $name = ($_ -split ":")[1].Trim(); (netsh wlan show profile name="$name" key=clear) -match "Key Content" -replace ".* : ", "$name : " }

Graphically, you can also view passwords via Settings:

  1. Go to Settings → Network & Internet → Wi-Fi → Manage known networks.
  2. Select the network → Properties → Security → Show characters.

This method is more user-friendly but requires navigating menus rather than typing commands.

Security and Privacy Considerations

Retrieving Wi-Fi passwords via CMD is safe when done legitimately, but it carries risks if misused:

  • Shared computers: Anyone with local admin rights can view saved passwords. Avoid storing credentials on public or shared machines.
  • Backup exposure: The netsh command can export all profiles to XML with netsh wlan export profile folder=C:\backups key=clear. These XML files contain plaintext passwords — delete them after use and restrict folder permissions.
  • Malware risk: Malicious scripts or tools claiming to "reveal all Wi-Fi passwords" often steal credentials or install backdoors. Always use official Microsoft tools.
  • Domain policies: In corporate environments, group policies may disable password export or require multi-factor authentication to view credentials.

Best practice: Never run unknown scripts in CMD, and avoid saving Wi-Fi passwords on devices you don’t control.

Limitations: What You Can’t Do

CMD-based retrieval has hard boundaries:

  • No cross-device access: You cannot retrieve passwords from other computers, phones, or routers — only from the local Windows profile store.
  • No recovery of forgotten passwords: If you’ve never saved the network on your current device, CMD won’t help. There’s no "master key" or universal password.
  • Doesn’t bypass network security: This retrieves stored credentials; it does not crack weak passwords or exploit vulnerabilities in your router.
  • Windows-only: macOS, Linux, Android, and iOS use different credential stores. On macOS, for example, passwords are in Keychain Access, not CMD.

For Android, you’d need rooted access and third-party tools (risky); on iOS, Apple blocks such access entirely for security reasons.

Frequently Asked Questions

Can I retrieve a Wi-Fi password I’ve never saved on my PC?
No. CMD can only show passwords for networks your Windows profile has previously connected to and saved. If you typed the password manually once and never saved it, or if the network was removed, it won’t appear in the profile list.

Why does the Key Content field show "Not specified"?
This typically means the network uses enterprise authentication (e.g., WPA2-Enterprise with RADIUS), where passwords are not stored locally. Each connection re-authenticates against a central server, so no static PSK exists on the device.

Does this work on Windows 11?
Yes. The netsh wlan command works identically in Windows 10 and 11. The graphical path differs slightly (Settings > Network & Internet > Wi-Fi > Manage known networks), but the underlying credential storage remains unchanged.

Can I find passwords for networks saved on my phone using CMD?
Not directly. Android and iOS do not expose saved Wi-Fi credentials to Windows tools. You’d need to check the phone’s settings or use device-specific recovery methods (e.g., Android backup, iCloud sync — though these rarely include plaintext passwords).

Is there a way to list all saved Wi-Fi passwords at once in CMD?
Yes — run netsh wlan show profiles to list all saved SSIDs, then pipe or loop through them (as shown in the PowerShell section). Alternatively, use netsh wlan export profile folder=%userprofile%\Desktop key=clear to generate XML files with all passwords on your desktop.

What happens if I forget the admin password but need the Wi-Fi password?
Without admin access to the Windows account where the network was saved, you cannot retrieve the password via CMD. You’d need to either reset the Windows password (losing some encrypted data) or use the network’s physical router label or admin page to reset it — but that changes the password for all devices.