netsh wlan command reference · Windows Wi-Fi from the CLI
The complete netsh wlan toolkit in one searchable place: reveal a saved Wi-Fi password, list and forget networks, back up and restore profiles, scan the air for the best channel, randomise your MAC for privacy, set a connection as metered, read your driver’s capabilities, generate the WLAN diagnostic report and run a software hotspot. Every command has a one-click Copy, an explanation, what you will see in the output, and copy-ready variants. Replace anything in <…> with your own value.
Placeholders: <SSID> = network name · <password> = your key · C:\... = a folder you choose. Read-only commands run as a normal user; ones tagged Admin need an elevated prompt (Run as administrator). Works identically in Command Prompt and PowerShell.
How to use this netsh wlan reference
The netsh wlan context manages the Windows wireless (WLAN AutoConfig) service from the command line. It works identically in Command Prompt and PowerShell because netsh is a standalone executable, not a shell built-in. Open a terminal, paste a command and replace any <placeholder> with your value. Almost every name you need comes from one command: run netsh wlan show profiles first to get the exact network names, then feed those names to the show, delete, export and connect commands. Each card below also lists variants, the small tweaks (a specific adapter, a single line of output, the reverse setting) that you reach for most often.
The five commands that cover most Wi-Fi tasks
| Goal | Command |
|---|---|
| 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 & 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 |
Admin rights vs standard user
Listing profiles, showing interfaces and scanning networks work in a normal terminal. You need an elevated Command Prompt or PowerShell (Run as administrator) to reveal keys, export with key=clear, configure or start the hosted network, turn tracing on, change WLAN AutoConfig, set MAC randomization and add or remove filters. If a command silently returns nothing or says access is denied, re-open the terminal as administrator and try again.
netsh wlan and modern Windows
The hosted-network hotspot commands are a legacy feature; current Windows builds steer you toward the graphical Mobile hotspot, and some drivers no longer advertise hosted-network support. Check netsh wlan show drivers for the line Hosted network supported: Yes before relying on it. Everything else here, especially the profile, password, export, randomization and diagnostic commands, remains fully supported and is the fastest way to manage Wi-Fi without clicking through Settings.
Frequently asked questions
How do I see my Wi-Fi password from the command line?
Run netsh wlan show profiles to find the network name, then netsh wlan show profile name="YourSSID" key=clear and read the value next to Key Content. That is the plaintext password. Revealing the key needs an administrator terminal.
Do netsh wlan commands need administrator rights?
Read-only commands such as show profiles, show interfaces and show networks work as a standard user. Revealing keys, exporting with key=clear, the hosted network, tracing, WLAN AutoConfig, MAC randomization and filters all require an elevated (Run as administrator) prompt.
How do I back up and restore my Wi-Fi profiles?
Create a folder, then run netsh wlan export profile key=clear folder="C:\WiFiBackup" to save every network as an XML file with its password. On the new PC, import each one with netsh wlan add profile filename="C:\WiFiBackup\Wi-Fi-SSID.xml". The exported files are named Interface-Profile.xml.
How do I set a Wi-Fi network as metered with netsh?
Use the profile cost parameter: netsh wlan set profileparameter name="YourSSID" cost=Fixed marks the network as metered, and cost=Unrestricted sets it back to unmetered. Metered networks pause large background downloads and some Windows Updates.
How do I randomize my MAC address for privacy?
For one network, run netsh wlan set profileparameter name="YourSSID" randomization=yes (or daily for a fresh address each day). For the whole adapter, use netsh wlan set randomization enabled=yes interface="Wi-Fi". The command fails if the driver does not support randomization.
Does netsh wlan work in PowerShell?
Yes. netsh is a standalone program, so it behaves the same in PowerShell and Command Prompt, including the pipe used in commands like netsh wlan show interfaces | findstr SSID. There is no separate PowerShell module needed for these tasks.
How do I create a Wi-Fi hotspot with netsh?
Confirm netsh wlan show drivers reports Hosted network supported: Yes, then run netsh wlan set hostednetwork mode=allow ssid="MyHotspot" key="password" and netsh wlan start hostednetwork. Share your internet connection to the new adapter in Network Connections. On current Windows, the graphical Mobile hotspot is often the better option.
Why does a netsh wlan command return nothing or an error?
The usual causes are: the Wi-Fi adapter is disabled, the WLAN AutoConfig (WlanSvc) service is stopped, the command needs administrator rights, or the driver does not support the feature (common for hosted network and randomization). Check the adapter, start WlanSvc, re-open the terminal as administrator, and verify capabilities with netsh wlan show drivers.













