Wifi password windows cmd: View saved networks
In this article
You can view saved Wi-Fi network passwords on Windows using the Command Prompt (CMD) by running a simple command that displays the security key in plain text. This method works only for networks your computer has previously connected to and saved.
How It Works
Windows automatically stores Wi-Fi network profiles, including SSID names and passwords, when you connect to a wireless network and choose to save the credentials. These profiles are managed by the operating system’s WLAN AutoConfig service and can be accessed via command-line tools with administrative privileges.
The netsh wlan command set allows users to interact with wireless network settings. By querying a specific saved profile, you can retrieve the password (listed as the "Key Content") if you have administrator rights.
Step-by-Step Instructions
- Open Command Prompt as Administrator:
- Press Windows + S, type cmd.
- Right-click on Command Prompt and select Run as administrator.
- Click Yes if prompted by User Account Control.
- List all saved Wi-Fi profiles:
- Type the following command and press Enter:
netsh wlan show profiles
- This displays every network your PC has stored.
- Type the following command and press Enter:
- View the password for a specific network:
- Replace
NETWORK_NAMEwith the actual SSID from the list:netsh wlan show profile name="NETWORK_NAME" key=clear
- Look for the Security settings section.
- Find the field labeled Key Content — this is the Wi-Fi password.
- Replace
Background: Wi-Fi Profile Storage in Windows
Since Windows Vista, Microsoft has used the wlan subsystem to manage wireless connections. Each saved network creates a profile stored in C:\ProgramData\Microsoft\Wlansvc\Profiles\Interfaces\ as XML files. These files contain encrypted password data, but the netsh tool decrypts and reveals it when run with proper permissions.
The key=clear parameter tells the system to display the security key in readable form. Without it, the password remains hidden. This functionality is built into Windows for troubleshooting and migration purposes, not as a security flaw.
Common Problems and Solutions
- "There is no profile with that name." — The network name was entered incorrectly. SSIDs are case-sensitive. Re-run
netsh wlan show profilesand copy the exact name, including spaces and special characters. - "You do not have permission to view this profile." — You did not run CMD as administrator. Close the window and reopen with elevated privileges.
- Password not showing under Key Content" — Some older profiles may have been saved without storing the password. Reconnect to the network and ensure "Connect automatically" is checked to re-save the full profile.
- Command not recognized" — Ensure you're using a Windows version with WLAN support (Windows 7 and later). This command does not work on Windows XP or server editions without the WLAN service enabled.
Safety and Security Considerations
While this method is legitimate for recovering your own passwords, it highlights a security reality: anyone with administrative access to your computer can see all saved Wi-Fi passwords. This includes malware or unauthorized users with physical access.
To protect yourself:
- Always use a strong login password on your Windows account.
- Enable BitLocker or device encryption for full-disk protection.
- Avoid saving sensitive network passwords on shared or public computers.
- Remove unused Wi-Fi profiles with
netsh wlan delete profile name="NETWORK_NAME".
Organizations often disable local administrator access precisely to prevent this type of information exposure.
Frequently Asked Questions
Can I see Wi-Fi passwords from other computers on my network using CMD?
No. The netsh wlan command only accesses wireless profiles stored locally on the machine where it is run. It cannot retrieve passwords from routers or other devices on the network.
Does this work on Wi-Fi networks I've never connected to?
No. You can only view passwords for networks your computer has previously joined and saved. The system does not store credentials for unknown networks.
Is this method safe and legal?
Yes, if you are accessing your own device with authorized administrative access. It is not legal or ethical to use this method on a computer you do not own or without permission.
Why doesn't the Key Content field show anything?
This usually means the password was not saved during connection. Some networks, especially enterprise or captive portals, do not store the pre-shared key locally. Reconnect and ensure the "Save password" option is selected.
Can I use PowerShell instead of CMD?
Yes. In PowerShell (as Administrator), you can use the same netsh wlan show profile name="SSID" key=clear command. PowerShell supports all netsh commands and offers additional scripting capabilities.
Will this work on a locked or encrypted router?
This method retrieves the password from your PC, not the router. The router’s admin password (used to log into 192.168.1.1, etc.) is unrelated and cannot be retrieved this way. You would need to reset the router to factory settings to recover its admin password.