How to View a Computer's Wi-Fi Password Using the Command Prompt: A Step-by-Step Guide

Forgot your home Wi-Fi password, and your router doesn't have a sticker with the connection details? Don't rush to reset the router or call your ISP. If your computer or laptop has connected to this network before, the password is stored in its memory—and you can retrieve it in a few seconds. Windows command lineThis method works on all OS versions from Windows 7 to Windows 11, does not require administrator rights (if you are already connected to the network) and leaves no traces in the system.

In this article you will find not only the basic command for viewing the password, but also an analysis of typical errors, alternative methods (for example, through PowerShell), as well as tips on how to protect your network if your password turns out to be too simple. We'll also explain why this method does not work for public networks (cafes, airports) - and what to do in such cases.

Why is my Wi-Fi password saved in Windows?

When you first connect to a wireless network, Windows automatically saves her profile - including SSID (network name), encryption type, and, of course, password. This data is stored in a special registry section and is used for automatic future connections. Even if you manually remove a network from the list of available networks, its profile may remain in the system.

The advantage of this mechanism:

  • There is no need to re-enter the password — the device connects automatically.
  • Works offline — data is stored locally, without dependence on cloud services.
  • Supports multiple profiles — you can store passwords from different networks (home, work, guest).

However, there are also risks: if someone else gains access to your computer, they will be able to retrieve all your saved passwords. Therefore, it is important protect your Windows account with a strong password or PIN code.

📊 How often do you change your Wi-Fi password?
Once a month
Once every six months
Only when moving
Never changed
I don't know what my password is.

Preparation: What to check before you begin

Before entering commands, make sure that:

  1. The computer is connected (or was previously connected) to the target networkIf you have never logged into this network, there is no data about it in the system.
  2. You have permission to view network settings.In most cases, a standard account is sufficient, but some commands (such as exporting all passwords) require administrator rights.
  3. The command prompt is launched as the current user.It is not necessary to use Run as administrator, if you do not plan to change the settings.

Open Command Prompt (Win + R → cmd)

Make sure your computer is connected to the correct network.

Run CMD as the current user (not necessarily admin)

Prepare a notepad to write down your password-->

If you are connected to the network via Ethernet (cable) rather than Wi-Fi, the method will still work—the main thing is that the network profile was previously saved. For example, if the laptop was connected to the router wirelessly but now uses a cable, the password will be available.

⚠️ Attention: If you are using a corporate network with 802.1X For networks with authentication (for example, in offices or universities), this method won't reveal the password. Such networks use certificates or login credentials that aren't stored in the standard Wi-Fi profile.

Basic Command: How to Find Out a Password in 30 Seconds

The fastest way is to use the command netsh, built into WindowsIt allows you to manage network settings, including viewing saved passwords. Here are the step-by-step instructions:

  1. Open command line:
    • Click Win + R, enter cmd and press Enter.
    • Or search for it: type "Command Prompt" in the menu Start.
  • Enter the command to view all saved networks:
    netsh wlan show profiles

    Find the name in the list (SSID) the desired network. For example, MyHomeWiFi_5G.

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

    Replace NETWORK_NAME on real SSID (For example, netsh wlan show profile name="TP-Link_1234" key=clear).

  • Find the line Key content (Key Content) - this is the password.
  • Example command output (password highlighted):

    ...
    

    Security settings:

    Authentication type: WPA2-Personal

    Encryption type: CCMP

    Key contents: 12345678Ab!

    ...

    Common mistakes and how to fix them

    If the command did not work or returned an error, check the following:

    Error Cause Solution
    Profile "NETWORK_NAME" not found The computer has not connected to this network or the profile has been deleted. Check that the network name is correct (case is important!). Try connecting to the network at least once.
    Access denied Insufficient rights to view the password. Run CMD as administrator (right click → Run as administrator).
    WLAN AutoConfig service is disabled The Wi-Fi management service is disabled. Turn it on: Win + Rservices.msc → find WLAN AutoConfig ServiceLaunch.
    The password is displayed as * The network uses WPA3 or corporate authentication. Try connecting to the network again or check the password on the router (usually on a sticker).

    If you see the message No connection data, this means the network profile is empty (for example, if the connection was interrupted during the password entry process). In this case, try connecting to the network again and retry the command.

    ⚠️ Attention: On some laptops with Intel or Killer Networking adapters command netsh may not show the password due to proprietary drivers. In this case, use the alternative method via PowerShell (see next section).

    Alternative methods: PowerShell and manual export

    If netsh didn't work, try one of these methods:

    1. Via PowerShell (for Windows 10/11)

    Open PowerShell (you can use search) and run:

    (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 output a table with all saved networks and their passwords.

    2. Via the Windows registry

    Passwords are stored in the registry at the following path:

    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Wlansvc\Interfaces\{GUID}\Profiles

    However, they are encrypted and will require additional utilities to decrypt them (for example, WirelessKeyView (from NirSoft). This method is suitable for experienced users.

    3. Export all passwords to a file

    To save all passwords to a text file, run:

    for /f "tokens=2 delims=:" %a in ('netsh wlan show profiles ^| find "All users"') do @echo %a & netsh wlan show profile name="%a" key=clear | findstr /C:"Key contents" >> WiFi_passwords.txt

    File WiFi_passwords.txt will appear in the user folder.

    Security: What to do if your password is too simple

    If the extracted password turns out to be simple (for example, 12345678 or qwerty), it should be changed immediately. Weak passwords are vulnerable to:

    • 🔍 Brute-force attack — password guessing using a dictionary.
    • 📡 WPS vulnerabilities - if it is enabled on the router WPS, it can be hacked in a few hours.
    • 👥 Social engineering — neighbors or guests can spy on the password.

    How to create a strong Wi-Fi password:

    • 🔐 Use 12+ characters (For example, GreenTree$2026!WiFi).
    • 🎲 Turn it on numbers, capital letters and symbols (!@#$%).
    • 🔄 Change your password once every 6–12 months.
    • 📵 Turn off WPS in the router settings (section Wi-Fi → Security).

    To change your password:

    1. Open your router's control panel (usually at 192.168.0.1 or 192.168.1.1).
    2. Log in (login/password usually admin/admin or indicated on the router sticker).
    3. Go to the section Wireless → Security (or Wi-Fi → Security Settings).
    4. In the field Password or Key Enter a new password and save the settings.
    ⚠️ AttentionAfter changing the password, all devices (phones, TVs, printers) will be disconnected from the network. Prepare a list of devices that will need to be reconnected in advance.

    What to do if the method doesn't work

    If none of the methods showed the password, the following reasons are possible:

    1. The network uses WPA3 or 802.1X — such profiles do not store the password in clear text.

    2. The network profile is corrupted. — try deleting the network in Windows settings and connecting again.

    3. The Wi-Fi adapter driver is non-standard. - some manufacturers (for example, Dell or HP) modify the network stack. In this case, only viewing the router password will help.

    4. Are you using a VPN or proxy? - Some corporate networks mask the real SSID.

    Alternative solutions:

    • 🖥️ Look at the password on another device, which connected to this network (phone, tablet).
    • 📋 Check it out sticker on the router — many providers indicate the factory password there.
    • 🔧 Reset your router to factory settings (button Reset for 10 seconds) and set it up again.
    • 📞 Contact us provider's technical support - they can reset the password remotely (for subscribers).

    If you rent a place or use a shared Wi-Fi network (for example, in a dorm), ask the network administrator for the password. Resetting the router yourself in such cases could result in a block.

    FAQ: Frequently asked questions about viewing Wi-Fi passwords

    Is it possible to find out the password for a Wi-Fi network I haven't connected to?

    No. Windows Stores passwords only for networks the computer has previously connected to. If you've never logged into a network (for example, a neighbor's), extracting its password via the command line is impossible. In such cases, the only options are social engineering (ask the owner) or specialized hacking programs (which is illegal).

    Will it be visible that I viewed the password via the command line?

    No, viewing the password is possible through netsh or PowerShell Leaves no traces in the system. These commands simply read data from the network profile without modifying it. However, if you export passwords to a file, it will remain on the disk—delete it after use if you're concerned about a leak.

    Does this method work on Mac or Linux?

    No, team netsh - this is a utility Windows. For macOS use the command:

    security find-generic-password -wa "NETWORK_NAME"

    On Linux passwords are stored in a file /etc/NetworkManager/system-connections/NETWORK_NAME (you need a license sudo).

    Is it possible to find out the password for mobile Internet (4G/5G) this way?

    No. Passwords for mobile data (for example, when connecting your phone as a modem) are not stored in Wi-Fi profiles. They are managed separately, through settings. Mobile hotspot or USB modemTo see this password, check the access point settings on your phone.

    What to do if the password is displayed as dots ()?

    This means that the network is using dynamic key (For example, WPA-Enterprise or 802.1X). Such networks are often found in offices, universities, or hotels and require a login and password to connect. Retrieving a static password in this case is impossible—contact the network administrator.