Setup and Configuration

How to Show Wifi Password Using Cmd? Command Prompt Method

Introduction Forgetting a WiFi password is a common frustration. Whether you are trying to connect a new device, helping a guest get online, or simply reconnecting your own laptop after a system reset, you need that network security key. Many people assume the

HowToFixWiFi

Introduction

Forgetting a WiFi password is a common frustration. Whether you are trying to connect a new device, helping a guest get online, or simply reconnecting your own laptop after a system reset, you need that network security key. Many people assume they must log into their router\u2019s admin panel or install third-party software to recover a saved password, but Windows offers a faster built-in option.

This guide explains how to show wifi password using cmd? and walks you through the entire process using Command Prompt. You do not need to download anything, and you do not need advanced networking knowledge. The method relies on a native Windows tool called netsh, which can display security settings for any wireless network your computer has previously connected to.

Throughout this article, you will learn the exact commands to type, how to interpret the output, what to do if something goes wrong, and how to keep your own network secure. The steps work on Windows 10, Windows 11, and earlier versions of Windows that support Command Prompt.

Table of Contents


What Is Command Prompt and Why Use It for WiFi Passwords?

Command Prompt, also known as cmd.exe, is the command-line interpreter built into Windows. It allows users to execute text-based commands to manage files, configure system settings, troubleshoot network connections, and perform administrative tasks without using a graphical interface.

When it comes to wireless networking, Windows stores every WiFi network you have successfully connected to in a local profile. Each profile contains the SSID (network name), security type, and the password, also known as the network key. Command Prompt can query these saved profiles through the netsh wlan context.

Using Command Prompt to show wifi password using cmd? offers several advantages:

  • No additional software: Everything you need is already installed on your Windows computer.
  • Speed: Once you know the command, retrieving a password takes only a few seconds.
  • No router access required: You do not need to know your router\u2019s admin username or password.
  • Works offline: You do not need an active internet connection to read a saved WiFi profile.

The downside is that you must have administrative privileges on the computer, and the network must have been connected to at least once before. If you have never joined the network, Windows will not have saved its password, and Command Prompt cannot reveal it.

Prerequisites Before You Begin

Before you attempt to show wifi password using cmd?, make sure the following conditions are met:

  • Windows operating system: This method is designed for Windows PCs. It does not work on macOS, Linux, Android, or iOS.
  • Administrator account: You must be logged in as an administrator or have administrator credentials to run the elevated Command Prompt.
  • Previously connected network: Your computer must have connected to the WiFi network in the past and saved the password.
  • Physical access: You need direct access to the computer that was previously connected to the network.
  • Correct network name: You should know the exact SSID of the WiFi network, or be willing to look it up using the commands provided below.

If you are using a work or school computer, your organization may restrict access to Command Prompt or prevent standard users from viewing saved wireless keys. In those cases, contact your IT department rather than attempting to bypass security controls.

How to Show Wifi Password Using Cmd? Step-by-Step Method

The most reliable way to show wifi password using cmd? is to use a four-step process. First, you open Command Prompt with administrative rights. Next, you ask Windows to list every wireless profile it remembers. Then, you target a specific network and request its security details. Finally, you locate the password in the command output.

Each step is explained below with the exact command you need to type.

Step 1: Open Command Prompt as Administrator

You must run Command Prompt as an administrator because viewing saved WiFi passwords requires elevated privileges. If you open a standard Command Prompt window, the netsh command may return an access denied error.

Follow these steps:

  1. Press the Windows key on your keyboard or click the Start button.
  2. Type cmd or Command Prompt in the search box.
  3. When Command Prompt appears in the results, right-click it.
  4. Select Run as administrator from the context menu.
  5. If a User Account Control (UAC) dialog appears, click Yes to allow the app to make changes to your device.

You will know the window is elevated if the title bar reads Administrator: Command Prompt instead of just Command Prompt.

Step 2: List All Saved WiFi Profiles

With the administrator Command Prompt open, the next step is to see every wireless network your computer has stored. Type the following command and press Enter:

netsh wlan show profiles

Windows will display a list under the heading User profiles. Each entry represents a WiFi network your device has connected to previously. The output looks similar to this:

User profiles
————-
All User Profile : HomeWiFi
All User Profile : Office_Network
All User Profile : CoffeeShop_Guest

If the list is long, you can scroll up in the Command Prompt window to find the network you need. Make a note of the exact network name (SSID), including capitalization and spaces, because you will need it for the next command.

Step 3: Choose the Network and Reveal the Password

Now that you know the exact name of the WiFi network, you can ask Windows to show the saved security key. Use the following command structure, replacing YOUR-WIFI-NAME with the actual SSID from Step 2:

netsh wlan show profile name="YOUR-WIFI-NAME" key=clear

For example, if your network is named HomeWiFi, the command would be:

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

The quotation marks are important if your network name contains spaces. If the name is a single word with no spaces, you can omit the quotes, but including them will not cause an error.

Press Enter after typing the command. Windows will retrieve the profile and display detailed information about the network.

Step 4: Read the Password from the Output

After running the command in Step 3, Command Prompt prints several sections of information, including general settings, connectivity options, and security settings. You need to look for the Security settings section.

Within that section, locate the line labeled Key Content. The text immediately to the right of Key Content is your WiFi password.

Example output snippet:

Security settings
—————–
Authentication : WPA2-Personal
Cipher : CCMP
Security key : Present
Key Content : MySecretPassword123

In this example, MySecretPassword123 is the WiFi password. You can now copy it, write it down, or use it to connect another device.

Understanding the Netsh WLAN Command Syntax

The commands used above rely on netsh, which stands for Network Shell. It is a command-line utility included with Windows that allows you to configure and display network settings. When you type netsh wlan, you are entering the wireless local area network context of the tool.

Here is a breakdown of the main command used to show wifi password using cmd?:

  • netsh \u2014 Launches the Network Shell utility.
  • wlan \u2014 Switches to the wireless LAN context.
  • show profile \u2014 Displays information about saved wireless profiles.
  • name="SSID" \u2014 Specifies which network profile to query.
  • key=clear \u2014 Instructs Windows to reveal the stored password in plain text.

If you omit key=clear, Windows will still show profile details, but it will hide the actual password and only indicate whether a security key is present. The key=clear parameter is what makes the password visible.

Alternative: Show All WiFi Passwords at Once Using Cmd

If you have many saved networks and do not want to run the profile command one by one, you can use a Command Prompt loop to display all saved WiFi passwords at once. This method is useful for auditing your own device, but the output can be lengthy.

Type or paste the following command in an administrator Command Prompt window:

for /f "tokens=*" %a in ('netsh wlan show profiles ^| findstr /i "SSID"') do netsh wlan show profile name="%a" key=clear

This command scans the profile list, extracts each network name, and runs the password reveal command for every entry. Because the output includes every detail for every network, you may want to save it to a text file for easier reading.

To export the results to a text file on your desktop, use this version:

netsh wlan show profiles > %USERPROFILE%\Desktop\wifi-profiles.txt

Then open the text file with Notepad to review the list. To include passwords in the export, you would need to run the loop command and redirect its output to a file, which produces a very large document.

Note: Batch loops behave differently when saved inside a .bat or .cmd script file. If you are creating a script, replace %a with %%a.

Command Prompt vs PowerShell vs Third-Party Tools

Windows users have several options for recovering saved WiFi passwords. The table below compares Command Prompt with PowerShell and third-party password recovery utilities.

Method Built into Windows Admin Rights Required Shows Saved Passwords Ease of Use Best For
Command Prompt (netsh wlan) Yes Yes Yes Moderate Quick recovery without installing software
PowerShell Yes Yes Yes Moderate Advanced users and automation scripts
Third-party WiFi password viewers No Usually Yes Easy Users who prefer a graphical interface
Router admin panel No (web-based) Router admin login Yes Moderate Changing the password or viewing current router settings

Command Prompt is often the best starting point because it requires no downloads and works on virtually every Windows computer. PowerShell can perform the same task but uses different cmdlets and syntax. Third-party tools offer visual convenience but introduce the risk of downloading untrusted software.

Troubleshooting Common Issues

Even when you follow the steps correctly, you might encounter an error or unexpected output. Below are the most common problems people face when trying to show wifi password using cmd? and how to resolve them.

Access is Denied

If you see Access is denied. after running the command, it means Command Prompt was not opened with administrator privileges. Close the window, right-click Command Prompt, and choose Run as administrator again.

The Specified Profile Does Not Exist

This error usually means there is a typo in the network name. WiFi names are case-sensitive. Double-check the exact SSID from the netsh wlan show profiles list and make sure you included quotation marks if the name contains spaces.

Key Content Is Blank

Sometimes the Key Content line appears empty or says Key Content : with no text after it. This can happen if:

  • The network was connected to using enterprise authentication (common in offices or universities), and the password is not stored locally in plain text.
  • The profile was deleted or corrupted.
  • You are viewing a network that was never saved with a password.

In these cases, Command Prompt cannot recover the password. You will need to contact the network administrator or reset the router.

Command Not Recognized

If you receive 'netsh' is not recognized as an internal or external command

, your system PATH variable may be corrupted. This is rare on modern Windows systems. Restarting the computer usually resolves the issue.

Security Tips and Best Practices

Knowing how to show wifi password using cmd? is useful, but it also comes with responsibility. Saved wireless passwords are sensitive information, and anyone with administrative access to your computer can retrieve them using the same method.

Follow these best practices:

  • Only use this method on computers you own or have explicit permission to manage.
  • Do not share screenshots of Command Prompt output that contain your WiFi password.
  • Log out or lock your computer when stepping away, especially in public or shared spaces.
  • Use standard user accounts for daily tasks and reserve administrator accounts for installations and system changes.
  • Clear your Command Prompt history or close the window after you finish retrieving the password.

If you suspect your WiFi password has been exposed, change it immediately through your router\u2019s admin panel and reconnect all your devices with the new key.

How to Protect Your WiFi Password from Being Exposed

Prevention is better than recovery. To keep your wireless network secure, take the following steps:

  • Use a strong password: Create a WiFi password that is at least 12 characters long and includes uppercase letters, lowercase letters, numbers, and symbols.
  • Enable WPA2 or WPA3 encryption: Avoid older standards like WEP, which are easy to crack. WPA3 is the most secure option available on modern routers.
  • Change the default router admin password: Many routers ship with predictable admin credentials. Change them as soon as you set up the device.
  • Set up a guest network: If visitors need internet access, give them a separate guest SSID with its own password instead of sharing your main network key.
  • Limit physical access: Anyone who can sit at your computer and open Command Prompt can view saved WiFi passwords. Keep your device locked when unattended.
  • Update router firmware: Manufacturers release security patches that protect against known vulnerabilities.

Frequently Asked Questions

Can I show wifi password using cmd? on a Mac?

No. The netsh wlan command is specific to Windows. On macOS, you would use the Keychain Access application or Terminal commands with the security utility to retrieve saved WiFi passwords.

Do I need to be connected to the WiFi network to see its password?

No. You only need to have connected to the network at least once in the past so that Windows saved the profile. You can retrieve the password even while connected to a different network or while offline.

Is it legal to use Command Prompt to show wifi password using cmd?

It is legal to recover passwords for networks you own or have permission to access. Using this method to access networks without authorization may violate computer crime laws and your internet service provider\u2019s terms of service.

Why does Key Content show nothing?

If Key Content is blank, the password may not be stored locally in recoverable form. This often happens with enterprise networks that use certificate-based authentication or with profiles that were imported without the security key.

Can I see passwords for networks I have never connected to?

No. Windows only saves profiles for networks you have joined. Command Prompt cannot discover or reveal passwords for networks within range that you have never used.

Will this work if I forgot my Windows administrator password?

No. You need to log in with an administrator account to open an elevated Command Prompt. If you are locked out of Windows entirely, you will need to recover your user account through Microsoft\u2019s account recovery options before using this method.

Can I export the list of saved WiFi passwords to a file?

Yes. You can redirect Command Prompt output to a text file using the > operator. For example: netsh wlan show profiles > C:\Users\YourName\Desktop\wifi.txt. To include passwords, you would need to run the profile reveal command for each network or use a loop script.

Is PowerShell better than Command Prompt for this task?

Neither is inherently better for simply viewing a saved WiFi password. Command Prompt uses a shorter, more familiar command (netsh wlan show profile). PowerShell can do the same thing but requires more complex syntax. Most users find Command Prompt faster for this specific task.

Conclusion

You now know exactly how to show wifi password using cmd? without installing any extra software. The process is straightforward: open Command Prompt as an administrator, list your saved wireless profiles, select the network you need, and run the netsh wlan show profile command with key=clear to reveal the stored password.

Remember that this method only works for networks your computer has previously connected to, and it requires administrator access. Use it responsibly, only on devices you own or manage, and always follow good security hygiene by using strong passwords and modern encryption on your own router.

If you run into trouble, refer back to the troubleshooting section for common errors like access denied or blank key content. And if you want to prevent others from easily retrieving your network key, secure your computer with a strong login password and lock it whenever you step away.