Networking

Wi-Fi Connections on This Computer: See Saved Networks and Passwords

To see the Wi-Fi connections on this computer, open Command Prompt or PowerShell and run netsh wlan show profiles: it lists every wireless network Windows has saved. To read a saved password, run netsh wlan export profile name="NetworkName" folder="C:\WiFiProfiles" key=clear from an elevated prompt and open the XML file it creates.

Replace NetworkName and the folder path in every command below with your own. The commands come from Microsoft's netsh wlan reference. Any output shown is example output, with made-up network names.

How to list the Wi-Fi connections on this computer

A "saved" network is a wireless profile: Windows stores the network name (SSID), the security type and the key, so it can reconnect without asking again. Microsoft describes netsh wlan show profiles as listing all configured wireless network profiles on the system.

netsh wlan show profiles

Example output:

Profiles on interface Wi-Fi:

Group policy profiles (read only)
---------------------------------
    <None>

User profiles
-------------
    All User Profile     : HomeNetwork
    All User Profile     : HomeNetwork-5G
    All User Profile     : CoffeeShop-Guest
    All User Profile     : OfficeWiFi

The names after the colon are the profile names. You need them for every other command in this article. The command works from a normal prompt, so you don't need administrator rights just to look at the list. If your PC has no wireless adapter, or the WLAN service isn't running, the command returns an error instead of a list.

Two details worth knowing. Many routers broadcast separate 2.4 GHz and 5 GHz names, so one home can show up as two profiles. And "Group policy profiles" are networks pushed by an administrator, typically on a work or school PC. Microsoft notes that Group Policy profiles are read-only and always take precedence over user profiles, so you cannot reorder them with set profileorder.

How to see which network you are connected to right now

The saved list is not the same as the active connection. To see the network this computer is joined to at the moment, run:

netsh wlan show interfaces

That prints the adapter details, including the SSID, state and signal. To see networks that are in range but not necessarily saved, use netsh wlan show networks, which Microsoft describes as displaying all visible wireless networks in range.

How to see a saved Wi-Fi password in Windows

The documented way is to export the profile with the key included. Open Command Prompt or Windows PowerShell as administrator (right-click it, then Run as administrator), create a folder, and export:

mkdir C:\WiFiProfiles
netsh wlan export profile name="HomeNetwork" folder="C:\WiFiProfiles" key=clear

Microsoft's page says key=clear displays the security key in plain text, but only if the caller is a local administrator. Otherwise the key is encrypted in the output file. The folder must already exist and must be a local path, because UNC paths aren't supported. Each file is named "Interface Name-Profile Name.xml", so the example above creates Wi-Fi-HomeNetwork.xml. If you leave out name=, every saved profile is exported, which is the quickest way to get all passwords at once.

The password sits in the keyMaterial element of the XML. To print just that line from the folder you created:

findstr keyMaterial C:\WiFiProfiles\*.xml

Example output:

C:\WiFiProfiles\Wi-Fi-HomeNetwork.xml:  <keyMaterial>example-password-123</keyMaterial>

Treat the files as secrets. They contain your network passwords in readable text. Delete them when you are done:

rmdir /s /q C:\WiFiProfiles

Check the path before pressing Enter, because /s /q removes the folder and everything in it without asking.

If an open network or a work network that signs in with a certificate or username has no keyMaterial line, that is expected: there is no shared password stored for it. The same goes for profiles that use 802.1X, where each person signs in with their own credentials.

How to remove a saved Wi-Fi network

To make this computer forget a network, delete its profile by name:

netsh wlan delete profile name="CoffeeShop-Guest"

Microsoft says the profile name can contain wildcard characters and that every profile matching the name is removed, so a name like CoffeeShop* deletes several at once. Be careful with that. If you pass interface="Wi-Fi", the profile is removed only from that adapter; without it, it is removed from all wireless interfaces.

The same result is available in the Settings app. In Windows 11, open Settings > Network & internet > Wi-Fi > Manage known networks, pick the network and choose Forget. The command line is the better route when the button is missing, or when you want to remove many profiles in one go. Our guide on fixing a laptop that keeps disconnecting from Wi-Fi uses this step when a saved profile has gone stale.

Deleting a profile only affects this computer. The router, and every other device that knows the password, carry on as before. To rejoin, pick the network from the list and type the password again.

Why it is worth cleaning up the list

Windows can rejoin a saved network automatically whenever it sees a network with that name. That is convenient at home and a small risk for open networks you used once, such as a cafe or hotel. If you no longer need them, delete those profiles. Our article on whether public Wi-Fi is safe covers the wider risks of open networks.

You can also stop Windows from joining a saved network automatically without deleting it. Microsoft documents netsh wlan set profileparameter name="OfficeWiFi" ConnectionMode=manual, which sets the connection mode to manual so the profile is used only when you pick it.

If the commands don't work

  • The list is empty. This computer has no saved wireless profiles, or you are on a wired connection with no Wi-Fi adapter. Run netsh wlan show interfaces to check that an adapter exists.
  • The key is encrypted or missing in the XML. You did not run the prompt as administrator, or you left out key=clear. Close the window, reopen it elevated and export again.
  • The export fails. Check that the folder already exists and that the path is local. UNC paths such as \\server\share are not supported.
  • Nothing is saved for a network you used before. The password may be stored on another device or in the router's admin page. This computer cannot show a key it never saved.

Microsoft also recommends PowerShell over netsh for managing networking in general, but its documentation covers no PowerShell equivalent for reading a Wi-Fi key, so the netsh commands above remain the documented route.

Frequently asked questions

How do I see all Wi-Fi connections on this computer?
Open Command Prompt or PowerShell and run netsh wlan show profiles. Microsoft documents this command as listing all configured wireless network profiles. Each profile is a network this computer has saved and may rejoin automatically.
Why is the password not shown in the exported file?
Microsoft says the key is written in plain text only when you pass key=clear and the caller is a local administrator. Otherwise the key is encrypted in the output file. Run the command from an elevated prompt with an administrator account.
Does deleting a profile remove the network from the router?
No. netsh wlan delete profile removes only this computer's saved copy of the network. The router and other devices are unaffected, and you can join the network again by entering its password.
Can I list networks that are in range but not saved?
Yes. netsh wlan show networks displays all visible wireless networks in range, which is a different list from the saved profiles that netsh wlan show profiles gives you.
Is it safe to leave the exported XML file on disk?
No. With key=clear the file holds the network password in readable text. Move it somewhere private while you need it, then delete it, and never email or upload it unprotected.

Sources