Ever been in a situation where you need to connect a new device to your home WiFi but can’t remember the password? Or maybe you’re setting up a new laptop and want to transfer all your saved networks without having to ask everyone for the password again. If you’re on Windows, there’s a powerful built-in tool that can export all your WiFi passwords in seconds: PowerShell. This guide is for anyone who wants to recover their WiFi passwords using nothing but the command line — no extra software, no sketchy downloads. By the end of this tutorial, you’ll have a neat list of all your saved networks and their passwords, ready to copy or back up.
PowerShell might sound intimidating if you’ve never used it before, but I promise it’s easier than it looks. This step-by-step walkthrough will hold your hand through every command. Whether you’re a beginner or a seasoned techie, you’ll be exporting passwords in under five minutes. We’ll cover exporting passwords for individual profiles, and also a script that dumps every saved network at once. So grab your coffee, open that Start menu, and let’s get started.
What You’ll Need
- A Windows PC (Windows 7 or later; Windows 10/11 recommended)
- Administrator access (you’ll need to run PowerShell as Admin)
- Your WiFi networks must have been saved on this PC at least once
- Patience to copy-paste a few commands
Step 1: Open PowerShell as Administrator
First, we need to launch PowerShell with elevated privileges. Click the Start button, type ‘PowerShell’, right-click on ‘Windows PowerShell’ in the search results, and select ‘Run as administrator’. If you see a User Account Control prompt, click ‘Yes’ to allow.

This is crucial because accessing WiFi profile security keys requires admin rights. Once the blue PowerShell window opens, you’re ready to start typing commands.
Step 2: List All Saved WiFi Profiles
Let’s first see what networks your PC remembers. Type or copy this command and press Enter:
PowerShell will output a list of all user profiles. Each profile corresponds to a WiFi network you’ve connected to. Note the exact name of the network you want to export — you’ll need it in the next step.

Step 3: Export a Single WiFi Password
To see the password for a specific network, use this command, replacing ‘WiFiName’ with the exact profile name from Step 2:
In the output, look for the line that says ‘Key Content’. The text next to it is your WiFi password. If you see ‘Key Content’ is blank or missing, the network may be using a different authentication type (like WPA2-Enterprise) that doesn’t store a simple password — but for most home networks, this works perfectly.

Step 4: Export All WiFi Passwords at Once
If you have multiple networks and want to get all passwords in one go, we can use a simple PowerShell script. Copy and paste the following command into your PowerShell window:
This script loops through every profile, extracts the password using the key=clear parameter, and prints each password on a new line. Make sure to run it as Administrator, or it will fail. For a cleaner output, you can also save the results to a text file by adding ‘> C:wifi_passwords.txt’ at the end of the command.

If you prefer a more robust script that includes the network names alongside passwords, check out our dedicated guide on PowerShell recovery for all profiles. It’s a lifesaver when you’re migrating to a new PC.
Step 5: Save the Output to a File (Optional)
To keep your passwords handy, redirect the output to a text file. For example, after the command in Step 4, add:
You can then open that file with Notepad or any text editor. Remember to delete the file after you’ve saved the passwords somewhere secure, like a password manager. For long-term storage, follow our backup guide to avoid losing access.
Common Pitfalls
- **Not running as Administrator**: If you open PowerShell normally, the netsh command will work but won’t show the password. Always right-click and run as Admin.
- **Profile name with spaces**: If your network name contains spaces, you must enclose it in double quotes inside the netsh command, e.g., name=”My Home WiFi”. The script in Step 4 handles this automatically.
- **Enterprise / 802.1X networks**: Some office or school networks don’t store a plain-text password. In that case, you’ll see ‘Key Content’ is absent. For such networks, see our office network recovery guide for alternative methods.
Where to Next
Congrats — you’ve just exported all your WiFi passwords using nothing but PowerShell! Now that you have them, consider keeping a secure backup. If you’re moving to a new computer, our command line script recovery can help you restore them. And if you prefer a graphical interface without ads, check out our free ad-free recovery tool. For those who want to avoid the command line altogether, we have guides for recovery without formatting and even recovering passwords from other devices like iPhones and Android phones. Happy connecting!