Forgot your home Wi-Fi password and there's no sticker with the connection information on your router? Or do you need to connect a new device but can't be bothered to find the paper with the access code? Windows Command Prompt (CMD) will help you quickly retrieve the saved password for any network your computer or laptop has previously connected to. This method works on all versions. Windows 7/8/10/11 and does not require installation of additional software.
Unlike searching for a password through the router settings (where you need to know the IP address and the admin login/password), the method with CMD It's easier and faster if your PC is already connected to the network. However, there are some caveats: this method will only work for networks whose data is saved in the system. If you've never connected to Wi-Fi or have reset your network settings, you'll have to look for alternative solutions.
In this article you will find:
- 🔍 Step-by-step instructions with commands for viewing the password
- 🛡️ Safety precautions and risk warnings
- ⚙️ Solutions to common errors (e.g., "No user profiles")
- 📊 Table with alternative methods for obtaining a password
- ❓ Answers to frequently asked questions on the topic
1. Preparation: Checking administrator rights and network profiles
Before entering commands, make sure your account is in Windows has rights administratorWithout them CMD won't show saved passwords. It's easy to check:
- Open
Start → Settings → Accounts → Your info. - There should be a caption under the username
AdministratorIf not, log in using a different account or request permission from the PC owner.
Also, check if the desired Wi-Fi network profile is saved. To do this:
- Click
Win + R, enterncpa.cpland pressEnter. - In the list of connections, find
Wireless networkand make sure that next to the name of your Wi-Fi there is a statusConnectedorIn memory.
2. Main command: how to find out the password through CMD
Now let's move on to the process itself. Open command prompt as administrator:
- Click
Win + S, entercmd. - In the search results, right-click on
Command lineand selectRun as administrator.
In the window that opens, enter two commands one after the other:
- View all saved networks:
netsh wlan show profilesFind the name in the list (
Profile name) your Wi-Fi. For example,TP-Link_1234. - Getting the password for a specific network:
netsh wlan show profile name="NETWORK_NAME" key=clearReplace
NETWORK_NAMEthe name of your Wi-Fi (in quotes!). For example:netsh wlan show profile name="TP-Link_1234" key=clear
After running the second command, find the line in the results Key content (Key Content). The value next to it is your Wi-Fi password.
What should I do if I see asterisks instead of a password?
In some versions of Windows, the password may be hidden behind characters. In this case, try copying the command output into a text file and searching for the line Key Material — sometimes the password is duplicated there.
3. Common mistakes and their solutions
The command doesn't always work the first time. Here are some issues and how to fix them:
| Error | Cause | Solution |
|---|---|---|
No user profiles |
The computer has never connected to this network. | Connect to Wi-Fi at least once or find the password on the router |
Access denied |
No administrator rights | Launch CMD on behalf of the administrator (see section 2) |
Profile not found |
Typo in network name | Check the case and characters in the command (eg. MyWiFi ≠ mywifi) |
WLAN AutoConfig service is disabled |
Service disabled WLAN AutoConfig | Turn it on through services.msc or by team net start Wlansvc |
Make sure that CMD Run as administrator|Check the network name for case and symbols|Connect to Wi-Fi at least once (if you haven't connected yet)|Enable the service WLAN AutoConfig (if disabled)-->
4. Alternative ways to find out your Wi-Fi password
If CMD If that didn't help or you prefer a graphical interface, here are 3 more working methods:
- 🖥️ Via "Windows Settings":
- Open
Start → Settings → Network & Internet → Wi-Fi. - Click
Managing known networks→ select your network →Properties. - Scroll to
Network passwordand pressShow symbols.
- Open
On the back panel of most routers (TP-Link, ASUS, Keenetic) the factory password is specified (field Password or Wi-Fi Key). If it hasn't been changed, it's still valid.
Enter in your browser 192.168.0.1 or 192.168.1.1, log in (login/password usually admin/admin) and find the section Wireless or Wi-Fi.
5. Security precautions: why you shouldn't share your password
Every time you share your Wi-Fi password with strangers, you risk not only your internet speed, but also the security of your network. Here's why:
- 🕵️ Access to local devices: Attackers can use your Wi-Fi to try to connect to printers, cameras, or even computers on the network.
- 📉 Channel congestion: Multiple device connections reduce internet speed for all users.
- 🔄 Changing router settings: If the password for the router admin panel is standard (
admin), the connected user can change it and block you.
⚠️ Attention: In some countries (such as Russia), unauthorized access to other people's Wi-Fi networks is considered a violation of the Federal Law "On Personal Data" (Federal Law No. 152) and can result in a fine of up to 100,000 rubles.
If you need to provide temporary access to a guest, it is better to:
- Create guest network on the router with a separate password.
- Use the function
WPS(if supported). - Enable time or device restrictions in your router settings.
6. How to protect your Wi-Fi from hacking
Having found out the password through CMD, it's worth considering your network security. Here are the minimum settings you should check on your router:
| Parameter | Recommended value | Why is this important? |
|---|---|---|
| Security type | WPA3-PSK (or WPA2-PSK) |
WEP And WPA vulnerable to hacking in minutes |
| Network name (SSID) | Unique, no personal data | Names like Ivanov_WiFi help attackers identify you |
| Password | 12+ characters, including numbers and special characters | Weak passwords (12345678) are selected by brute force in hours |
| Hiding the SSID | Do not turn on | This does not protect against hacking, but it makes it more difficult to establish a legitimate connection. |
⚠️ Attention: If your router is older than 5 years, check if it supports WPA3. Obsolete models (D-Link DIR-300, TP-Link TL-WR740N) often have vulnerabilities that are not fixed by the manufacturer.
For additional protection:
- 🔄 Change your Wi-Fi password regularly (every 3-6 months).
- 📱 Turn off
WPS- This function is vulnerable to attacks like Pixie Dust. - 🖧 Enable filtering by
MAC addresses(although this is not a panacea).
7. Frequently asked questions about working with CMD and Wi-Fi
❓ Is it possible to find out the password for a neighbor's Wi-Fi through CMD?
No. Team netsh wlan show profile shows only those networks to which it was connected your computer. For other people's networks, specialized tools will be required (for example, Aircrack-ng), the use of which may be illegal.
❓ Why is the password missing after resetting the router? CMD does not match what is on the sticker?
When resetting the router (Reset) it returns to factory settings, including the password. However, Windows saves the old password in the network profile. To update the data, remove the network from known connections (Settings → Wi-Fi → Manage known networks) and reconnect.
❓ Does this method work on MacOS or Linux?
No, team netsh — a utility exclusively for WindowsOn . MacOS The password can be viewed through Keychain Access (Utilities → Keychain), and on Linux — by command:
sudo cat /etc/NetworkManager/system-connections/NETWORK_NAME | grep psk=
❓ Is it possible to export all Wi-Fi passwords to a file?
Yes. Run the command:
netsh wlan export profile key=clear folder="C:\WiFi_Passwords\"
This will create in the specified folder .xml- files with all saved networks and passwords. Keep the file in a safe place!
❓ Why did the command stop working after a Windows update?
In rare cases updates Windows can reset permissions for WLAN AutoConfigCheck the service status:
sc query Wlansvc
If the condition is not RUNNING, run it:
net start Wlansvc