How to find your Wi-Fi password using the Windows 10 command line

It's quite common to need to connect a new device to your home or office network but have forgotten the Wi-Fi password. Paper notes are often lost, and in the memory of a phone or old laptop, this information is hidden behind asterisks or doesn't appear in a clear format at all. Fortunately, the operating system Windows 10 Stores access keys to previously connected networks in a special storage facility, and they can be retrieved without using third-party software.

The most reliable and fastest way to access this information is using the built-in command line utility. This method requires no additional software installation, works even in safe mode, and provides direct access to system network settings. You don't need to be a professional programmer to execute a few simple commands that will restore your internet access.

In this article, we'll cover the password recovery process in detail, explain command syntax, and address potential errors. You'll learn how to manage network profiles, view their properties, and, most importantly, display hidden security keys. This knowledge is essential for any PC user who wants to deeply understand their operating system.

Getting Started with the Command Line

Before entering commands, you must launch the console with the appropriate access rights. Normal user mode may not allow viewing saved security keys for system security reasons. Therefore, the first step should always be to launch the terminal as administrator. This is critical, as without it, the system will return an access violation.

There are several ways to open the required tool. You can right-click the Start button and select "Windows PowerShell (Admin)" or "Command Prompt (Admin)." You can also use the system search by entering the query cmd, then right-click on the found application and select the appropriate launch mode.

Once the black terminal window opens, you're ready to go. The interface may seem daunting to a beginner, but it's here that the most powerful management tools are hidden. WindowsDon't be afraid to enter text, as we will only use proven system utilities that cannot damage your data.

⚠️ Caution: Enter commands carefully, including spaces and capitalization. While the risk of system damage is minimal, a syntax error may cause the command to fail or produce incorrect results.

Make sure the computer you're using has previously connected to the Wi-Fi network whose password you want to find out. If the device has never connected to this router, there will be no saved profile. In this case, the only way to recover the key is through the router's settings or by resetting it to factory settings.

📊 How do you usually store Wi-Fi passwords?
I write it down on paper/sticky note
I remember or keep in my head
I save it in a password manager/browser
I never change the factory password.

View a list of saved Wi-Fi networks

The first logical step is to get a complete list of all wireless networks your computer has ever connected to. System Windows stores this data in the form of profiles. To view a list of them, use the utility netsh, which manages the shell's network settings.

Enter the following command into the terminal window and press Enter:

netsh wlan show profiles

Once completed, you'll see a block of information under the "User Profiles" heading. It will list all networks. The names may be displayed in Cyrillic or Latin characters, depending on how the network was named when you first connected. Find the desired name in the list and remember its exact spelling, as you'll need it in the next step.

Sometimes the list may include old networks from neighbors or public places you connected to at a cafe. This is normal; the system saves them for automatic reconnection when a familiar signal is detected. However, we're only interested in your home or work profile.

If the list is empty, this computer has never connected to any Wi-Fi network, or the profile was previously deleted. In this case, you won't be able to find the password through this PC, and you'll have to find another device that has previously successfully connected to the router.

Obtaining the password for a specific network

Now that the profile name is known, you can request its detailed settings, including the security key. The command syntax requires the profile name to be enclosed in quotation marks if it contains spaces, although the system often understands it without them. However, to avoid errors, it's best to use quotation marks.

Enter the command in the following format, replacing "NetworkName" with your actual name:

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

Parameter key=clear is the key parameter in this instruction. It tells the system to display the contents of the key field in clear text, rather than obscuring it with symbols. Without this parameter, you'll only see technical network characteristics, such as the security type or channel.

After entering the command, scroll down a bit to the "Security settings" section. There you'll find the "Key Content" line. The value next to this line is the password you need for your Wi-Fi network.

This method works for most encryption standards, including WPA2-Personal and WPA3. If the key field is empty or displays zeros, the profile may be corrupted or access rights to that specific key may be restricted by your organization's group security policies.

Parameter Description Where to look in the output
Profile name Wi-Fi network name At the very top of the information block
Security type Encryption protocol Security Settings section
Key content The Wi-Fi password itself Security Settings section, last line
Connection mode Automatic or manual Connection Settings section

Please note that the password remains case-sensitive. If the key contains capital letters, they must be entered in that exact case when connecting a new device. Even a single character error will result in access being denied.

Alternative Method: Bulk Export Profiles

There's a more advanced method that allows you to export all profile settings at once to XML files. This can be useful if you need to transfer settings to another computer or back up your network configuration before reinstalling the system. This method requires working with the file system.

First, export all profiles using the command:

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

This command will create XML files for each saved profile in the root of the C: drive. By opening the file in Notepad, you can find the tag keyMaterial, which will contain the password in clear text. This is especially convenient if the network name contains complex characters that are difficult to enter manually into the command line.

⚠️ Warning: After use, be sure to delete the created XML files, as they contain passwords in clear text and can be read by any user or malware that has access to the disk.

Using XML files provides a more structured view of the data. You can see not only the password, but also the encryption type, channel frequency, and other technical details typically hidden in standard console output. This is a great way for system administrators to audit configured networks.

What to do if the password in the XML file is encoded?

In rare cases, if the profile was imported from another computer with certain settings, the key may be encrypted. In this case, the standard export method won't work, and you'll have to use the original device or reset the router.

Possible errors and solutions

When working with the console, users often encounter error messages. The most common one is "The specified profile could not be found." This occurs if you misspelled the network name. Spaces and case are important in names. Use the list view command again and copy the name exactly, or retype it carefully.

Another common issue is a lack of administrator rights. If you forget to run the console as an administrator, the system will not allow you to run the command. key=clearYou'll receive an access denied message. Simply close the window and reopen it, selecting the correct launch mode.

It's also possible that a profile exists, but the password isn't displayed. This often happens on corporate networks that use server-based authentication (802.1x) rather than a simple key. In such cases, the password isn't stored locally in plaintext, but is requested from the server each time a connection is established. You can find it out via netsh in this case it is impossible.

  • 🔍 Check the spelling of your profile name, including spaces.
  • 🔐 Make sure the console is running as administrator.
  • 📡 Make sure your computer has successfully connected to this network before.
  • 🏢 For corporate networks, this method may not work due to security policies.

If none of the above methods work, the registry profile may be corrupted. In this case, you can try deleting the old profile with the command netsh wlan delete profile name="Network_Name" and reconnect, entering the correct password (if known from another device). This will create a new, clean record in the system.

Deleting old and unnecessary profiles

Over time, the list of networks can grow, including access points from neighbors or old routers. To maintain order and security, it's recommended to delete unused profiles. This also speeds up the process of finding the right network when automatically connecting.

To remove, use the command:

netsh wlan delete profile name="Network_Name"

The system will confirm the deletion with the message "Profile successfully deleted." After this, the entry will disappear from the list, and the computer will stop attempting to connect to this network automatically. This also completely erases the saved password from the device's memory, which is useful when transferring the computer to another user.

Clearing your profiles is a good digital hygiene practice. If you've connected to open networks at airports or cafes, deleting them will reduce the risk of automatically connecting to rogue hotspots with similar names in the future.

⚠️ Note: Command interfaces and functionality may vary slightly across different builds of Windows 10 and Windows 11. If a command doesn't work, check the official Microsoft documentation for your OS version.

Regularly auditing connected networks helps not only with organization but also with diagnosing connection issues. Sometimes, conflicting old settings can prevent a stable connection with an updated router.

☑️ Wi-Fi Security Checklist

Completed: 0 / 4

Frequently Asked Questions (FAQ)

Is it possible to find out the Wi-Fi password if I have never connected to this network from this PC?

No, this is technically impossible via the command line on this computer. Windows only stores passwords used for a successful connection. If the device doesn't "know" the network, it has no data to display. In this case, you need to find a device already connected to the network or look at the password on the router's sticker.

Does this method work on Windows 7 and Windows 8?

Yes, it is a utility. netsh is present in all modern versions of Windows, starting with Vista. The command syntax remains virtually identical. The only difference may be the method for launching the Command Prompt as an administrator, which in older versions is found through the Start menu.

Is it safe to use netsh commands to view passwords?

Completely secure. You're not making any changes to the system, just requesting the display of existing data. The command show is read-only. The risk only arises if you start using commands. delete or set without understanding their purpose.

What should I do if the output contains an empty string instead of a password?

This could mean several things: either you don't have administrator rights, or the network uses a corporate security protocol where the password isn't stored locally. Also, check to see if the profile is corrupted. Try reconnecting to the network and manually entering the password to refresh the profile.