netsh wlan Command Reference
Search every netsh wlan command for Windows, copy it in one click, with output and variants.
Every netsh wlan command you actually reach for, gathered into one searchable, copy-ready reference for Windows. This is the fast way to drive Wi-Fi from the command line in either Command Prompt or PowerShell, since netsh wlan is just the front end to WLAN AutoConfig. Type a task or keyword and the matching cards surface instantly: reveal a saved Wi-Fi password, list and forget profiles, back them all up and restore them on a new PC, scan for the least-crowded channel, mark a connection metered, randomize your MAC, read what the driver supports, or build the WLAN diagnostic report. Each card carries a plain explanation, the example output you get back, and the handy variants. Commands that need an elevated prompt are clearly tagged Admin.
100% in your browser. Nothing you type ever leaves this page.
netsh wlan command reference · Windows Wi-Fi from the CLI
Half of these I can never remember. So I dumped every netsh wlan command I actually reach for into one page you can search. Digging out a saved Wi-Fi password. Listing the networks you've joined, forgetting one, backing the whole lot up and shoving it back onto a fresh machine. Scanning the air for a clear channel. Flagging a connection as metered when the data cap gets close. Randomising your MAC. Reading what the driver can actually do, building that WLAN report when the connection keeps dropping. Even spinning up a little software hotspot, if your adapter still allows it. Each card gives you a one-click Copy and a plain explanation, plus the output you'll get back and the variants I end up needing. Anything wrapped in <...> is yours to swap in.
Placeholders: <SSID> = network name · <password> = your key · C:\... = a folder you pick. Read-only stuff runs as a normal user. The ones tagged Admin want an elevated prompt (Run as administrator). Same behaviour in Command Prompt and in PowerShell.
How to use this netsh wlan reference
netsh wlan is really just the command-line front end to WLAN AutoConfig, the Windows service that runs your Wi-Fi under the hood. It behaves the same in Command Prompt and in PowerShell, because netsh is its own little program, not a shell built-in. Open whichever terminal you like, paste a command, drop your own value wherever you see <placeholder>. One trick ties the whole thing together, though: run netsh wlan show profiles first. It hands you the exact network names, and those names are what every show, delete, export and connect command is fishing for. The cards carry variants too. Little tweaks I keep needing, like aiming at one adapter or pulling a single line out of the output. Or just flipping a setting back.
The five commands that cover most Wi-Fi tasks
- Reveal a saved Wi-Fi password:
netsh wlan show profile name="SSID" key=clear - List every saved network:
netsh wlan show profiles - Check the current connection and signal:
netsh wlan show interfaces - Back up all profiles with passwords:
netsh wlan export profile key=clear folder="C:\WiFiBackup" - Diagnose flaky Wi-Fi:
netsh wlan show wlanreport
Reveal a saved Wi-Fi password
This is why most people land here. You're on a laptop that's been joined to a network for months, the password's long forgotten, and now you want it for your phone. Two commands. First netsh wlan show profiles to read off the exact name. Then netsh wlan show profile name="YourNetwork" key=clear, and the password is sitting on the Key Content line in plain text. Catch is, that second one only coughs up the key from an admin terminal. Run it as a normal user and the line's just blank, no warning, nothing. People assume it's broken. It isn't, you just need the elevated prompt. The name has to match what show profiles printed, character for character, and if there's a space in it you keep the quotes.
Admin rights vs standard user
The harmless stuff runs fine in a plain terminal: listing profiles and interfaces, scanning for what's around. The moment you want to do something that actually matters, though, you'll need an elevated prompt (right-click, Run as administrator). That's revealing keys, exporting with key=clear, anything to do with the hosted network, turning on tracing, poking at WLAN AutoConfig, setting MAC randomization, adding or pulling filters. Here's the bit that trips people up. When you're not elevated, a few of these don't even error. They just print nothing at all. So if a command comes back empty, or barks about access denied, reopen the terminal as admin and run it again.
Frequently asked questions
How do I see my Wi-Fi password from the command line?
Two steps. Run netsh wlan show profiles to grab the network's exact name. Then netsh wlan show profile name="YourSSID" key=clear and read the Key Content line. That's your password, sitting there in plain text. Careful, though: the second command only spills the key from an admin terminal. From a normal one that line just stays blank.
Do netsh wlan commands need administrator rights?
Some do, some don't. The read-only ones are happy as a standard user: show profiles, show interfaces, show networks, that sort of thing. But the moment you want to reveal keys, or export with key=clear, or mess with the hosted network, start tracing, change WLAN AutoConfig, set MAC randomization, touch filters, you'll need that elevated prompt. When you're not sure, honestly, just run it as administrator and move on.
How do I back up and restore my Wi-Fi profiles?
Make the folder first. Then run netsh wlan export profile key=clear folder="C:\WiFiBackup". That drops one XML file per network, password and all. Over on the new machine you pull each one back in with netsh wlan add profile filename="C:\WiFiBackup\Wi-Fi-SSID.xml". The files come out named Interface-Profile.xml, so match that pattern when you point the import at them.
Does netsh wlan work in PowerShell?
Yep. No surprises there. netsh is its own executable, so it runs the same whether you're in PowerShell or in Command Prompt. Even a pipe like netsh wlan show interfaces | findstr SSID behaves identically in both. No need to hunt down some PowerShell module for any of it. The same commands just work.
Why does a netsh wlan command return nothing or an error?
In my experience it's almost always one of a few things. The Wi-Fi adapter is switched off. The WLAN AutoConfig service (WlanSvc) isn't running. You needed admin rights and didn't have them. Or the driver simply doesn't do that feature, and hosted network and randomization are the usual no-shows. So work down the list, then run netsh wlan show drivers to see what your hardware actually supports.