How to view your Wi-Fi password on Windows 10 using the command line: detailed instructions

Forgot your home Wi-Fi password, and the sticker on your router has worn off? Or need to connect a new device but don't have your phone with your saved data handy? Windows 10 There is a simple way to recover the password for any saved network - through command line (CMD)This method works even if you're not a system administrator, as long as your computer has connected to the network at least once.

Unlike the graphical interface, where passwords are hidden behind asterisks, CMD It provides information in its purest form. But there are some caveats: this method will only work for networks you've previously connected to. If you need to hack someone else's Wi-Fi, it's not legally possible, and we won't discuss such methods. In this article, we'll discuss only legal scenarios: Recover your password, transfer settings to other devices, or diagnose connection problems.

The advantages of this method:

- Does not require installation of third-party programs.

- Works on all versions Windows 10/11 (including Home And Pro).

- Faster than digging through the router settings 192.168.1.1.

But there are also limitations - we will discuss them below.

📊 Why do you need to recover your Wi-Fi password?
Connect a new gadget
Forgot your password
I'm helping a friend/relative
Diagnosing network problems
Other

Preparation: What you need to know before you begin

Before you start using commands, check a few key points:

  • 🔹 The computer must have connected to this network before.If you've never entered a password on this PC, the data is simply missing from the system.
  • 🔹 Administrator rights requiredNo, but if the network was connected under a different account, you will need access to it.
  • 🔹 Does this method work for guest networks?Yes, if the guest network is saved in the profiles Windows.
  • 🔹 Is it possible to find out the password from the neighbors this way?No. This violates the data privacy law (Article 272 of the Criminal Code of the Russian Federation).

If you use corporate network (for example, in an office or university), the password can be stored in encrypted form or managed through 802.1X-authentication. In this case, the command line won't help—contact your network administrator.

⚠️ Attention: Some antiviruses (for example, Kaspersky Internet Security) can block access to network profiles through CMDTemporarily disable protection if the commands do not work.

Step 1: Open Command Prompt with Administrator Privileges

To avoid access errors, run CMD as an administrator. This can be done in three ways:

  1. Via search: click Win + S, enter "command line", then select "Run as administrator".
  2. Via the Start menu: right click on the icon Windows, select "Command Prompt (Administrator)".
  3. Via Task Manager: click Ctrl + Shift + Esc, then “File → Run new task”, enter cmd and check the box "Create task with administrator rights".

If you have it disabled UAC (User Account Control), the command prompt will open without prompting for a password. Otherwise, enter your administrator credentials.

Step 2: View a list of saved Wi-Fi networks

Now we need to find out the exact name (SSID) the network whose password you want to recover. To do this, enter the command:

netsh wlan show profiles

As a result, you will see a list of all networks this computer has ever connected to. Example output:

User profiles

Total user profiles: 3

Profile name: HomeWiFi

Profile name: Office_5G

Profile Name: Starbucks_Free

Please pay attention to the case and spaces in the names - they must match when entered into the following command. If the network name contains special characters (for example, MyWiFi@2026), put it in quotation marks.

⚠️ Attention: If the desired network isn't listed, your computer hasn't connected to it, or the profile has been deleted. Try connecting to the network again and repeat the command.

Step 3: Obtaining the password for the selected network

When did you determine SSID, use the command to display detailed information about the network, including the password:

netsh wlan show profile name="NETWORK_NAME" key=clear

Replace NETWORK_NAME to the real name from the previous step. For example:

netsh wlan show profile name="HomeWiFi" key=clear

In the execution results, find the block Security SettingsThere will be a line there. Key content — this is your password. Example:

Security parameters

Authentication type: WPA2-Personal

Encryption type: CCMP

Key contents: 12345678QwErTy

If you see a blank line or the message "Missing" instead of a password, it means:

  • 🔸 The network uses a different type of authentication (eg. WPA3-Enterprise).
  • 🔸 The password was changed on the router after the last connection.
  • 🔸 The network profile is damaged (try deleting it and connecting again).

Please check that the network name is correct (case sensitive)|

Make sure the command is run as administrator|

Try connecting to the network again and repeat the command|

Check if your antivirus is blocking access to network profiles-->

Alternative method: via PowerShell

If CMD for some reason it doesn't work, you can use it PowerShell - a more modern tool WindowsThe commands will be slightly different:

  1. Open PowerShell as administrator (similarly CMD).
  2. Enter the command to view all networks:
    (netsh wlan show profiles) | Select-String "\:(.+)$" | %{$name=$_.Matches.Groups[1].Value.Trim(); $_} | %{(netsh wlan show profile name=$name key=clear)} | Select-String "Key contents\W+\:(.+)$" | %{$pass=$_.Matches.Groups[1].Value.Trim(); [PSCustomObject]@{PROFILE_NAME=$name;PASSWORD=$pass}} | Format-Table -AutoSize

This command will automatically output a table with all networks and their passwords. Example output:

Network name (SSID)Password
HomeWiFi12345678QwErTy
Office_5GP@ssw0rd2026
CoffeeShop(empty)

The advantage of this method is automation: You don't need to manually enter each network name. However, the command is harder to remember, so save it in Notepad.

Common mistakes and how to fix them

Even simple procedures can go wrong. Let's look at common problems and solutions:

ErrorCauseSolution
Failed to execute netsh command Service WLAN AutoConfig disabled Run it through services.msc or run:
net start WlanSvc
Access denied Insufficient rights Launch CMD from administrator
Profile name not found Typo in the network name Check the case and spaces in SSID
Key content: (empty) The password is not saved in the system. Reconnect to the network with the "Connect automatically" checkbox checked.

If after all manipulations the password is still not displayed, check:

  • 🔧 Router settings: the mode may be enabled WPS or MAC filtering, which block standard authentication methods.
  • 🔧 Antivirus: some programs (for example, Avast) can delete network profiles as "suspicious".
  • 🔧 Updates Windows: after major updates (for example, Windows 10 22H2) network settings may be reset.
Why don't some networks save passwords?

Some public networks (such as those in hotels or airports) use Portal Captive — a web page for authorization. In this case, Windows saves only the connection data, but not the password, since it is not required for repeated access.

Security: How to protect your password from being recovered

If you are a network administrator and want to prevent password recovery through CMD, use these measures:

  • 🔐 Change the encryption type With WPA2-Personal on WPA3-Personal or WPA2/WPA3-Enterprise. The latter requires an authentication server (for example, Radius), which makes it impossible to recover the password through standard means Windows.
  • 🔐 Disable saving passwords On devices: In the connection settings, uncheck "Connect automatically."
  • 🔐 Use a guest network For temporary devices. The password can be changed more frequently.
  • 🔐 Set up MAC filtering on the router to restrict access to only authorized devices.

For corporate networks it is recommended to use 802.1X-certificate authentication. In this case, passwords are not stored on devices, and access is managed by a central server.

⚠️ Attention: Even if you have secured your network to the maximum, physical access to the device (for example, a laptop) allows you to bypass most security protections. Keep your equipment in a safe place!

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. Windows Stores passwords only for networks the computer has previously connected to. If the network isn't on the list netsh wlan show profiles, there is no data available. The only legal solution is to contact the network administrator or look at the password on the router's sticker (if it hasn't been changed).

Does this method work on Windows 11?

Yes, teams netsh wlan fully compatible with Windows 11The interface may be slightly different, but the functionality is the same. Windows 11 23H2 We also added the ability to view passwords through a graphical interface: Settings → Network & Internet → Wi-Fi → Manage known networks.

Is it possible to find out the password for a mobile hotspot (access point from a phone) this way?

No. Mobile hotspots (for example, with iPhone or Android) use dynamic passwords that are not saved in profiles WindowsTo see the password, check the hotspot settings on your phone itself: this is usually in the "Tethering" or "Access Point" section.

Why did my Wi-Fi passwords disappear after resetting Windows?

When doing a clean install or reset Windows (the "Delete all" option) all network profiles are deleted. If you made a system backup (for example, via Macrium Reflect), you can restore profiles from the folder C:\ProgramData\Microsoft\Wlansvc\Profiles\InterfacesOtherwise, you will have to enter passwords again.

Is it possible to export all Wi-Fi passwords to a file?

Yes. Run the command to export all profiles:

netsh wlan export profile key=clear folder="C:\WiFi_Backup\"

In the folder C:\WiFi_Backup\ will appear .xml- files with data for all networks, including passwords. These can be imported on another PC using the command:

netsh wlan add profile filename="C:\WiFi_Backup\HomeWiFi.xml"