Setup and Configuration

How to Get Wifi Password on Pc? Export Via Netsh

Introduction If you have ever connected your Windows PC to a Wi-Fi network and later forgotten the password, you are not alone. Many users search for “How to Get Wifi Password on Pc?” after realizing they need the password to connect another device, share it w

HowToFixWiFi

Introduction

If you have ever connected your Windows PC to a Wi-Fi network and later forgotten the password, you are not alone. Many users search for “How to Get Wifi Password on Pc?” after realizing they need the password to connect another device, share it with a friend, or troubleshoot a network issue. Fortunately, Windows stores every Wi-Fi password you have ever connected to, and you can retrieve it using built-in tools — no third-party software required.

One of the most powerful and reliable methods involves the netsh command in Command Prompt. The netsh utility lets you export Wi-Fi profiles, reveal saved passwords, and even back up all your network credentials in one go. Whether you are using Windows 10 or Windows 11, this method works consistently and gives you full control over your network data.

In this guide, we will walk you through every step of the process. You will learn how to get wifi password on pc using netsh, how to export profiles, how to interpret the output, and how to stay safe while doing it. By the end, you will be able to recover any saved Wi-Fi password on your machine in seconds.

Table of Contents

Why You Might Need to Recover a Wi-Fi Password

There are many everyday situations where you need to know how to get wifi password on pc. Perhaps you bought a new phone or tablet and need to connect it to your home network. Maybe you are setting up a smart TV, a gaming console, or a smart home device. Or perhaps you are visiting a friend’s house and want to connect a laptop, but neither of you remembers the password.

Another common scenario is when you are troubleshooting network connectivity issues. Knowing the exact password helps you verify whether the problem is authentication-related or something else, such as a router malfunction or IP conflict. IT professionals and system administrators also frequently need to recover Wi-Fi credentials when migrating users to new machines or rebuilding systems.

Whatever your reason, Windows has built-in tools that make recovery straightforward. You do not need to reset your router or call your internet provider. The netsh command gives you direct access to all stored Wi-Fi profiles and their passwords.

What Is the Netsh Command?

netsh stands for “Network Shell.” It is a command-line scripting utility included in Windows that allows you to display or modify the network configuration of a computer. Network administrators use it to manage network interfaces, firewall rules, wireless profiles, and much more.

For Wi-Fi password recovery, the relevant subset is netsh wlan, which handles wireless LAN configurations. With a few simple commands, you can list every saved network, view the password (called the “key content”) for any profile, and export all profiles to XML files — including their passwords.

The beauty of netsh is that it is available on every Windows PC by default. You do not need to install anything. You just need to open Command Prompt with the right privileges and type the commands.

Prerequisites Before You Begin

Before you start, make sure you meet the following requirements:

  • You must be logged in with an account that has administrator privileges. Standard user accounts cannot view Wi-Fi passwords.
  • Your PC must have previously connected to the Wi-Fi network in question. If the network was never saved, there is no password to recover.
  • You need access to Command Prompt. You can open it by searching for “cmd” in the Start menu.
  • You should run Command Prompt as Administrator. Right-click on it and select “Run as administrator.”

If you are on a work or school computer, your IT department may have restricted access to netsh commands. In that case, you may need to contact your administrator.

Method 1: View All Saved Wi-Fi Profiles

The first step in learning how to get wifi password on pc is to see which networks your computer remembers. Open an elevated Command Prompt and type the following command:

netsh wlan show profiles

Press Enter. You will see a list of all Wi-Fi profiles stored on your machine. The output looks something like this:

User profiles
-------------
    All User Profile     : HomeNetwork
    All User Profile     : OfficeWiFi
    All User Profile     : CoffeeShop_Guest

Each name listed is a saved network. Note the exact name (including spaces and capitalization) of the network whose password you want to recover. You will need it for the next step.

This command is also useful for auditing — you can see every network your PC has ever connected to, which is helpful for security reviews.

Method 2: Reveal the Password for a Specific Network

Now that you know the profile name, you can retrieve its password. Use this command, replacing “NetworkName” with the actual network name:

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

For example, if your network is called “HomeNetwork,” you would type:

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

Press Enter. Windows will display detailed information about that profile. Scroll down to the “Security settings” section. You will see a line that reads:

Key Content            : YourActualPassword

The value next to “Key Content” is your Wi-Fi password. Write it down or copy it carefully. Note that if the network uses an enterprise authentication method (like 802.1X), the password field may be blank or show a different type of credential.

This is the most direct answer to “How to Get Wifi Password on Pc?” — a single command reveals everything you need.

Understanding the Output

The output of the command contains several useful fields:

  • SSID name — the network identifier.
  • Network type — usually “Infrastructure.”
  • Authentication — such as WPA2-Personal or WPA3.
  • Cipher — such as CCMP or TKIP.
  • Key Content — the actual password.

If “Key Content” is blank, it usually means the profile was created without saving the password, or the profile is corrupted. Try re-entering the password manually or reconnecting to the network.

Method 3: Export All Wi-Fi Profiles with Passwords

If you want to back up all your Wi-Fi profiles — including their passwords — in one go, the netsh export command is the way to go. This is especially useful when migrating to a new PC or creating a backup before reinstalling Windows.

Here is how to do it:

  1. Open Command Prompt as Administrator.
  2. Create a folder to store the exported files. For example, create a folder called WiFiBackup on your Desktop.
  3. Type the following command and press Enter:
netsh wlan export profile key=clear folder="C:\Users\YourUsername\Desktop\WiFiBackup"

Replace “YourUsername” with your actual Windows username. If the path contains spaces, keep the quotation marks.

Windows will export each saved profile as an XML file. Each file contains the network name, authentication type, encryption method, and the password in plain text (because of key=clear). You can open these XML files in any text editor to read the passwords.

If you omit key=clear, the passwords will be encrypted in the XML files and cannot be read directly. Always include key=clear if you want readable passwords.

Reading the Exported XML Files

Open any exported XML file in Notepad. Look for the <keyMaterial> tag. The text between the opening and closing tags is your Wi-Fi password. For example:

<keyMaterial>MySecretPassword123</keyMaterial>

This makes it incredibly easy to copy passwords and store them in a password manager or share them securely with another device.

Method 4: Import Exported Profiles on Another PC

Once you have exported your Wi-Fi profiles, you can import them on another Windows PC. This is a huge time-saver when setting up a new machine. Here is how:

  1. Copy the exported XML files to the new PC (via USB drive, cloud storage, etc.).
  2. Open Command Prompt as Administrator on the new PC.
  3. Navigate to the folder containing the XML files using the cd command.
  4. Type the following command:
netsh wlan add profile filename="ProfileName.xml"

Replace “ProfileName.xml” with the actual file name. Repeat for each profile you want to import. Alternatively, you can use a wildcard to import all XML files at once:

for %i in (*.xml) do netsh wlan add profile filename="%i"

After importing, your new PC will automatically connect to those networks when they are in range, using the saved passwords.

Comparison of Methods

Here is a quick comparison of the methods covered so far:

Method Best For Requires Admin? Exports All? Difficulty
netsh show profile key=clear Single password recovery Yes No Easy
netsh export profile key=clear Full backup / migration Yes Yes Easy
PowerShell Get-NetAdapter Scripting / automation Yes Partial Moderate
Windows Settings GUI users Yes No Very Easy
Third-party tools Non-technical users Varies Yes Very Easy

Each method has its place. If you just need one password quickly, Method 2 is fastest. If you are migrating or backing up, Method 3 is the most comprehensive.

Using PowerShell as an Alternative

If you prefer PowerShell over Command Prompt, you can achieve similar results. PowerShell offers more flexibility for scripting and automation. Here is a basic approach:

  1. Open PowerShell as Administrator.
  2. Run the following command to list profiles:
netsh wlan show profiles

Yes, you can run netsh commands directly in PowerShell. But if you want a more PowerShell-native approach, you can use the Get-NetAdapter cmdlet combined with other tools. However, for Wi-Fi password recovery, netsh remains the most reliable built-in option.

For advanced users, you can write a PowerShell script that loops through all profiles and extracts passwords automatically:

$profiles = netsh wlan show profiles | Select-String "All User Profile" | ForEach-Object { ($_ -split ":")[1].Trim() }
foreach ($profile in $profiles) {
    $password = (netsh wlan show profile name="$profile" key=clear | Select-String "Key Content").ToString().Split(":")[1].Trim()
    Write-Output "$profile : $password"
}

This script outputs every saved network name alongside its password. It is a great tool for IT administrators managing multiple machines.

Using Windows Settings to Find Passwords

If you prefer a graphical interface, Windows Settings also lets you view saved Wi-Fi passwords — but only for the network you are currently connected to. Here is how:

  1. Open Settings (Windows + I).
  2. Go to Network & Internet > Wi-Fi.
  3. Click on Hardware properties (or “Manage known networks” in older versions).
  4. Look for the View button next to the password field, or click “Show characters.”

This method is limited because it only shows the password for your active connection. For all other saved networks, you must use netsh or a third-party tool. That is why learning how to get wifi password on pc via netsh is so valuable — it works for every saved profile, not just the current one.

Troubleshooting Common Issues

Even with the right commands, you may encounter issues. Here are common problems and their solutions:

“Access Denied” Error

This happens when Command Prompt is not running as Administrator. Close the window, right-click on Command Prompt, and select “Run as administrator.” Then retry the command.

“Profile Not Found” Error

Double-check the network name. It must match exactly, including spaces and capitalization. Run netsh wlan show profiles again to verify the exact name.

Blank “Key Content” Field

If the password field is empty, the profile may have been created without saving the password, or the credentials may be stored in Windows Credential Manager instead. Try connecting to the network again and checking “Remember this network” to save the password.

XML Import Fails on New PC

Make sure the XML file was exported with key=clear. Also verify that the new PC’s wireless adapter supports the same authentication and cipher types. Older adapters may not support WPA3, for example.

Command Not Recognized

If netsh is not recognized, your system PATH may be corrupted. You can run it with the full path: C:\Windows\System32 etsh.exe. Alternatively, try running sfc /scannow to repair system files.

Security Tips and Best Practices

Learning how to get wifi password on pc is powerful, but it also carries responsibility. Here are important security considerations:

  • Never share passwords publicly. Only share Wi-Fi credentials with trusted individuals.
  • Store passwords securely. Use a reputable password manager instead of plain text files.
  • Delete exported XML files after you have imported them or copied the passwords. These files contain passwords in plain text.
  • Lock your PC. Anyone with physical access to an unlocked PC can run these commands and steal your passwords.
  • Use strong, unique passwords. If your Wi-Fi password is weak, this is a good opportunity to change it on your router.
  • Audit saved profiles regularly. Run netsh wlan show profiles periodically to remove networks you no longer use. You can delete a profile with netsh wlan delete profile name="NetworkName".
  • Enable WPA3 if your router supports it. WPA3 offers stronger encryption than WPA2.

These practices ensure that the convenience of password recovery does not come at the cost of your network security.

Frequently Asked Questions

Can I get Wi-Fi passwords without admin rights?

No. Viewing saved Wi-Fi passwords requires administrator privileges. This is a deliberate security measure by Microsoft. If you are not an admin, you will need to ask someone who is.

Does this work on Windows 7, 8, 10, and 11?

Yes. The netsh wlan commands work on all modern Windows versions, including Windows 7, 8, 8.1, 10, and 11. The syntax is identical across versions.

Can I recover a password for a network I am not currently connected to?

Yes. As long as the network profile is saved on your PC, you can retrieve its password using netsh wlan show profile name="NetworkName" key=clear. You do not need to be connected.

Is it legal to recover Wi-Fi passwords this way?

It is legal to recover passwords for networks you own or have permission to access. Using these methods on someone else’s PC or network without authorization may violate computer fraud and privacy laws.

What if the password contains special characters?

The netsh output displays the password exactly as stored. If it contains special characters, copy it carefully. When using the password in other contexts, make sure to handle special characters appropriately (e.g., quoting in scripts).

Can I recover passwords on a Mac using similar commands?

Mac uses a different system. On macOS, you can find saved Wi-Fi passwords in the Keychain Access app. The netsh command is Windows-specific.

How do I delete a saved Wi-Fi profile?

Use the command netsh wlan delete profile name="NetworkName". This removes the profile and its stored password from your PC. It is a good practice to delete profiles for networks you no longer use.

Conclusion

Now you know exactly how to get wifi password on pc using the netsh command. Whether you need a single password, want to back up all your profiles, or are migrating to a new machine, the methods in this guide give you everything you need. The netsh wlan show profile name="NetworkName" key=clear command is your go-to for quick recovery, while netsh wlan export profile key=clear handles bulk backups effortlessly.

Remember to always run Command Prompt as Administrator, double-check network names for exact spelling, and follow the security best practices outlined above. With these tools and tips, you will never be locked out of your own Wi-Fi network again. Keep your passwords safe, audit your saved profiles regularly, and enjoy the convenience of having your network credentials at your fingertips whenever you need them.