How to Find Your Wi-Fi Password Using the Command Prompt (CMD): A Complete Guide

Forgot your home or office Wi-Fi password, but your computer is connected to the network? Command Prompt (CMD) V Windows Allows you to retrieve a saved password without installing third-party software. This method works if you've previously connected to the network and the system has remembered the security key. However, there are some caveats: not all networks store passwords in plaintext, and corporate access points (WPA-Enterprise) require different approaches.

In this article you will find:

  • 🔍 Step-by-step instructions with commands to extract the password through netsh.
  • ⚠️ Limitations of the method — when CMD won't help and why.
  • 🛡️ Alternative methods for different versions Windows (from 7 to 11).
  • 📌 Safety tips - How to protect your network from such leaks.

Warning: This method is intended only to restore access to your networksUsing it to hack other people's access points is illegal (Article 272 of the Russian Criminal Code - "Unauthorized access to computer information").

1. Preparation: checking administrator rights and Windows version

Before attempting to extract the password, please make sure that:

  • 🖥️ Your computer already connected to the target Wi-Fi network (or was connected to it previously).
  • 👤 You have rights administrator - without them netsh will not show the password.
  • 🪟 Version Windows no older 7 (V XP the method does not work).

To check administrator rights:

  1. Open Start → Windows Settings → Accounts → Your info.
  2. There should be a caption under the username "Administrator".
📊 What version of Windows are you using?
Windows 10
Windows 11
Windows 7/8.1
Other

If you don't have rights, try:

  • 🔑 Log in using a different account with administrator rights.
  • 🛠️ Temporarily elevate privileges via Run as administrator (right click on CMD).
⚠️ Attention: IN Windows 11 with the latest updates (2026+) interface netsh may give out the password in encrypted form. In this case, use alternative methods.

2. Step-by-step instructions: extracting a password via CMD

Follow these instructions to find out the password for your current or previously connected Wi-Fi network:

  1. Open Command Prompt as Administrator:
    • Click Win + R, enter cmd.
    • Clamp Ctrl + Shift + Enter (or right click → Run as administrator).
  • View the list of saved networks:
    netsh wlan show profiles

    In the results, find the name (SSID) the desired network (for example, "MyWiFi_5G").

  • Extract the password for a specific network:
    netsh wlan show profile name="NETWORK_NAME" key=clear

    Replace NETWORK_NAME on real SSID (without quotes if there are no spaces in the name).

  • Find the line Key Content:

    The password will be listed to the right of Key content (in the English version - Key Content).

  • The network name is entered correctly|The command prompt is run as administrator|The computer is connected to the target network (or has been connected before)|The Windows version supports netsh (7/10/11)

    -->

    Example of command output:

    
    

    Security settings:

    Authentication type: WPA2-Personal

    Encryption type: CCMP

    Key contents: 12345678Ab!

    ⚠️ Attention: If you see asterisks () or an empty line, then:

    • The network uses WPA-Enterprise (corporate authentication).
    • The password was entered manually and was not saved in the system.
    • Version Windows modified (for example, LTSC).

    3. Common mistakes and their solutions

    If the team netsh If it doesn't work or gives an error, check these points:

    Error Cause Solution
    Failed to execute command No administrator rights Run CMD as administrator (see step 2)
    Profile 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 WLAN AutoConfig doesn't work Turn it on through services.msc or by command:
    net start WlanSvc
    The password is displayed as Network with WPA-Enterprise or the password is not saved Use alternative methods

    If you see the message This command is only supported on Windows 7 and later., Means:

    • 🖥️ You have Windows XP or older version (method does not work).
    • 🛠️ The system is modified (for example, Windows PE).

    4. Alternative methods for different versions of Windows

    If netsh didn't work, try these methods:

    📌 For Windows 10/11: View through "Options"

    1. Open Start → Settings → Network & Internet → Wi-Fi.
    2. Click Managing known networks → select network → Properties.
    3. Scroll to Network password and press Show symbols.

    📌 For Windows 7/8: Usage WirelessKeyView

    Free utility NirSoft WirelessKeyView Shows all saved Wi-Fi passwords:

    1. Download the program from official website.
    2. Launch WirelessKeyView.exe (no installation required).
    3. Find the desired network in the list - the password will be in the column Key (Ascii).

    📌 For macOS/Linux

    On Mac use the command:

    security find-generic-password -wa "NETWORK_NAME"

    On Linux (if the network is saved in NetworkManager):

    sudo grep psk= /etc/NetworkManager/system-connections/"NETWORK_NAME"
    ⚠️ Attention: Utilities like WirelessKeyView can be recognized by antivirus software as potentially dangerous (due to access to system data). Download them only from official sources!

    5. How to protect your network from such leaks

    If you are a network administrator, minimize the risk of password leakage:

    • 🔒 Use WPA3 instead of WPA2 — the new encryption standard is more difficult to crack.
    • 🔄 Change your password regularly (once every 3-6 months).
    • 📱 Set up a guest network for temporary devices.
    • 🛡️ Turn it off WPS - This protocol is vulnerable to brute force attacks.
    • 📊 Keep a log of connected devices in the router settings.

    To change the password on your router:

    1. Open your router's control panel (usually at 192.168.1.1 or 192.168.0.1).
    2. Go to the section Wi-Fi → Security (or Wireless → Security).
    3. Select encryption type WPA2-PSK/WPA3-SAE and enter a new password.
    4. Save the settings and reconnect all devices.

    For corporate networks:

    • 🏢 Use WPA-Enterprise with the server RADIUS (For example, FreeRADIUS).
    • 🔑 Set up certificate authentication or 802.1X.
    How do you know if your Wi-Fi has been hacked?

    If unknown devices appear in the list of connected devices (in the router panel) MAC addressesIf your internet speed drops suddenly without any apparent reason, this could indicate unauthorized access. Also, check your router logs for suspicious connection attempts.

    6. Legal aspects: what the law says

    IN Russia Unauthorized access to other people's networks is regulated by:

    • Article 272 of the Criminal Code of the Russian Federation — "Unauthorized access to computer information" (a fine of up to 500,000 rubles or imprisonment for up to 4 years).
    • Article 13.11 of the Code of Administrative Offenses of the Russian Federation — violation of network operation rules (fine of up to 3 thousand rubles for individuals).

    In other countries:

    • 🇺🇸 In USAComputer Fraud and Abuse Act (CFAA) (fines up to $250 thousand).
    • 🇪🇺 In EUNetworks and Information Systems (NIS) Directive.

    Even if you "just connected to your neighbor's open network," it could be considered a violation if:

    • The network was password-protected, but you bypassed the protection.
    • You used the network for illegal actions (for example, downloading pirated content).
    • Your actions have led to damage (for example, channel overload).
    ⚠️ Attention: Even if the password was obtained "accidentally" (for example, through netsh on someone else's computer), its use without the permission of the network owner is a violation.

    7. Frequently Asked Questions (FAQ)

    ❓ Is it possible to find out the password for a Wi-Fi network I've never connected to?

    No. Method with netsh This only works for networks to which the computer has previously connected and saved the password. For other networks, you will need other tools (for example, Aircrack-ng), but their use illegally.

    ❓ Why are asterisks displayed instead of a password?)?

    This means that:

    • The network uses WPA-Enterprise (the password is not saved locally).
    • The password was entered manually and was not saved in the system.
    • Version Windows modified (for example, Windows 10 LTSC).

    Try alternative methods from Section 4.

    ❓ Does this method work on Windows 11 24H2?

    In the latest builds Windows 11 (2026–2026) team netsh may issue an encrypted password. In this case:

    1. Use PowerShell:
      (Get-NetConnectionProfile | Where-Object { $_.Name -eq "NETWORK_NAME" }).GetNetworkConnectivity() | Select-Object Password
    2. Or check your password via Settings → Network & Internet (cm. Section 4).
    ❓ Is it possible to find out the Wi-Fi password on a phone (Android/iOS) this way?

    On Android (with rights root):

    • Use File Explorer and open the file /data/misc/wifi/WifiConfigStore.xml.
    • Or install WiFi Password Viewer (requires root).

    On iPhone:

    • Without jailbreak - impossible.
    • With jailbreak - use WiFi Passwords from Cydia.
    ❓ How do I reset my Wi-Fi password if it can't be recovered?

    If you have forgotten your password and cannot retrieve it:

    1. Connect to the router via cable (Ethernet).
    2. Open your router's control panel (usually 192.168.1.1).
    3. Go to Wi-Fi → Security and set a new password.
    4. If you don’t know the login/password for the router, do it factory reset (button Reset on the back panel).

    ⚠️ After resetting, all router settings (including PPPoE, IPTV, Port forwarding) will return to factory settings!