Forgot your home Wi-Fi password, and the sticker on your router has worn off? Or do you need to connect a new device but are too lazy to find the router box? Windows 10 There is an easy way to retrieve the saved password from any network your computer has ever connected to - via command line (CMD).
This method works even if you're not a system administrator (with limitations), doesn't require installing any third-party programs, and takes less than a minute. We'll cover it in this article. three options obtaining a password: for the current network, for all saved networks and using PowerShell For advanced users. We'll also tell you how to protect your data if someone else has access to your computer.
⚠️ Important: Extracting passwords via the console is only possible for networks that previously connected this computer. If the network is not in the list of saved ones, this method will not work. Also, keep in mind that some corporate networks use dynamic passwords (for example, through 802.1X), which cannot be recognized in this way.
Why is CMD the best way to find out Wi-Fi password?
Let's compare the command line with alternative methods:
| Way | Advantages | Flaws | Do you need admin rights? |
|---|---|---|---|
| Command Prompt (CMD) | ✅ Fast (1 command), always works, no need to install software | ❌ You need to remember the command; some networks require administrator rights. | Partially* |
Control Panel (ncpa.cpl) |
✅ Visual interface, suitable for beginners | ❌ Slower, doesn't show passwords for "foreign" networks | Yes |
| Third-party programs (For example, WirelessKeyView) | ✅ Shows all passwords at once, export to file | ❌ Risk of viruses, blocked by antivirus software, requires installation | Yes |
| Resetting the router | ✅ Works on any network | ❌ All settings will be reset, you will have to set up the router again | No |
*Without administrator rights, you can only see the password for CMD current networkTo view all saved passwords, you need administrator rights.
Method 1: View the password for your current Wi-Fi network
If your computer currently connected You can retrieve the Wi-Fi password without administrator rights. Just one command is enough:
Open command line:
- 🔍 Click
Win + R, entercmdand pressEnter. - 🖱️ Or search for it in Windows: type "cmd" → select "Command Prompt".
- 🔍 Click
Enter the command:
netsh wlan show interfaces
Find the line in the results SSID — This is the name of your network. Remember it.
Now enter the command to extract the password (replace NETWORK_NAME to your SSID):
netsh wlan show profile name="NETWORK_NAME" key=clear
Find the section in the results Security parameters → line Key contentThis is your password.
☑️ What to check before entering a command
⚠️ Attention: If the network name contains spaces or Cyrillic characters, enclose the SSID in quotation marks: name="My Wi-Fi Network"Otherwise the command will not work.
Method 2: Find out passwords for ALL saved networks
To see passwords from all networks, to which the computer has ever been connected, will require administrator rightsHere's how to do it:
Launch CMD as administrator:
- 🔍 Click
Win + X→ select "Command Prompt (Administrator)". - 🛡️ Or find it through the search, right-click on "Command Prompt" → "Run as administrator".
- 🔍 Click
Enter the command to display list of all saved networks:
netsh wlan show profiles
Remember the network names from the column All user profiles.
For each network, run the command (replace NETWORK_NAME):
netsh wlan show profile name="NETWORK_NAME" key=clear | findstr "Key Contents"
This command will immediately show only the line with the password, without unnecessary information.
How to save all passwords to a text file?
Run the command for /f "skip=1" %a in ('netsh wlan show profiles') do @echo %a & netsh wlan show profile name="%a" key=clear | findstr "Key Contents" >> wifi_passwords.txt. File wifi_passwords.txt will appear in the user folder.
⚠️ Attention: If you use corporate network with authentication via 802.1X (for example, in offices or universities), the password on the command line may be displayed as AbsentThis is normal - such networks use dynamic keys.
Method 3: PowerShell Alternative (for Advanced Users)
PowerShell — a more powerful tool than CMD. It can be used to extract passwords in a more convenient format, such as a table.
Launch PowerShell as administrator:
- 🔍 Click
Win + X→ "Windows PowerShell (Administrator)". - 📝 Or enter in the search
powershell, right-click → "Run as administrator".
- 🔍 Click
Enter the command to display all networks with passwords:
(netsh wlan show profiles) | Select-String "\:(.+)$" | %{$name=$_.Matches.Groups[1].Value.Trim(); $_} | %{(netsh wlan show profile name="$name" key=clear)} | Select-String "SSID NAME\|Content\W+\s+\:" | %{$_.Line} | %{$_.Split(':')[1].Trim()} | %{$SSID=$_[0]; $Pass=$_[1]; Write-Output "SSID: $SSID | Password: $Pass"}
The result will be in the following format:
SSID: MySet | Password: 12345678
SSID: Living Room | Password: qwerty123
What to do if the password is not displayed?
Sometimes instead of a password you see Absent or an empty string. Reasons and solutions:
- 🔌 The network is not saved on this PC. → Connect to the network at least once so that Windows saves the password.
- 🔒 Corporate authentication (For example,
WPA2-Enterprise) → The password is stored on the server, not locally. Please contact your network administrator. - 🛡️ Antivirus is blocking access → Temporarily disable protection or add an exception for
netsh.exe. - 👤 Insufficient rights → Run CMD/PowerShell as administrator.
- 🖥️ The password is saved in another Windows profile. → Log in with the account that connected to the network.
Security: How to protect your passwords from prying eyes?
If other people have access to your computer (for example, at your office or at a friend's house), they can extract passwords in the same way. How to protect yourself:
- 🔐 Use an account without admin rights for everyday tasks. This way, outsiders won't be able to see your passwords for all networks.
- 🔄 Change your Wi-Fi password regularly (at least once every 3-6 months). This will reduce the risk of leakage.
- 🛡️ Set up a guest network on the router for temporary users. The master password will remain secret.
- 🔒 Disable saving passwords in Windows settings (but then you will have to enter the password every time you connect).
- 📱 Use WPS or QR code for connecting guests - so they won't know the main password.
⚠️ Attention: If you sell or transfer your computer to another person, Be sure to delete all saved networksTo do this, run the command:
netsh wlan delete profile name="*"
This will clear all Wi-Fi profiles, including passwords.
Common mistakes and how to avoid them
Even a simple command can make a mistake. Let's look at some typical cases:
| Error | Cause | Solution |
|---|---|---|
Failed to execute netsh command |
CMD is not run as administrator (to view all networks) | Close CMD and run it again as administrator. |
Profile name not found |
There is a typo in the network name or the network is not saved. | Check the name via netsh wlan show profiles |
WLAN AutoConfig service is disabled |
Service disabled WLAN AutoConfig | Turn it on: Win + R → services.msc → find the service and start it |
The password is displayed as * |
You are using an outdated version of Windows or a corporate policy. | Update Windows or try PowerShell |
How to enable WLAN AutoConfig service if it is disabled?
1. Click Win + R, enter services.msc.
2. Find a service WLAN AutoConfig Service.
3. Right-click → "Properties" → "Startup type: Automatic".
4. Click "Run" → "OK".
FAQ: Answers to Frequently Asked Questions
Is it possible to find out the password for a Wi-Fi network I've never connected to?
No. Teams netsh Only work with networks saved in Windows profiles. If the computer has never connected to the network, the password cannot be retrieved. Alternatives:
- Look at the password on the router sticker.
- Log into the router's web interface (usually at
192.168.0.1or192.168.1.1). - Reset the router to factory settings (the password will become default).
Does this method work on Windows 11?
Yes, teams netsh wlan fully compatible with Windows 11The interface may differ, but the principle remains the same. Windows 11 can also be used PowerShell 7+ for more flexible work with passwords.
Is it possible to extract a password from someone else's computer without permission?
Technically yes, but that's breaks the law (Article 272 of the Criminal Code of the Russian Federation - unauthorized access to computer information). In addition:
- In corporate networks, passwords are often encrypted.
- Antivirus software may block such actions.
- The network administrator will see suspicious activity.
Use this method only for their own networks or with the owner's permission.
How can I find out the password if my computer is connected via cable (Ethernet)?
If your computer is connected to the router via cable, but has previously connected to its Wi-Fi, you can extract the password via CMD (see Method 2). If you have never connected:
- Log in to the router's web interface (the address is on the sticker).
- Log in (login/password usually
admin/adminoradmin/empty). - Find the section Wi-Fi or Wireless network → Security.
Why doesn't the password work after resetting the router?
After resetting the router to factory settings:
- Network Name (
SSID) and the password are reset to the default values (indicated on the sticker). - If the sticker is missing, try the standard combinations for your model (eg.
adminor12345678). - Some providers block access to router settings—please contact support.