guide · static export
PC · wifi

Back Up and Restore Your Wi-Fi Profiles Before a Reinstall

Every saved network, including its key, is one exported XML file per SSID. Export them now and the new install joins your networks without passwords.

by@guidox updated:10/31/26 time:15 min level:Beginner tested on:Windows 11 24H2 works on:Windows 10, Windows 11 tools:Command Prompt as administrator
TL;DR

Export every profile with **netsh wlan export profile key=clear folder=...**, keep the XML files safe because they contain the **plaintext key**, and import them later with **netsh wlan add profile**.

Before you start

Requirements

  • Admin rights for key=clear
  • A folder for the XML files
  • 15 minutes
Step by step

Instructions

01

List the profiles you actually have

**netsh wlan show profiles** names every saved network. That list is your checklist for the restore — profiles you never connect to are not worth exporting.

netsh wlan show profiles
netsh wlan show interfaces
02

Export all profiles with their keys

**key=clear** writes the network key into the file. Without it the export is useless after a reinstall, because Windows cannot recover the key from a profile alone.

New-Item -ItemType Directory -Path C:\WifiBackup -Force | Out-Null
netsh wlan export profile key=clear folder=C:\WifiBackup
⚠ warningThe XML holds the password in plain text. Store it on an encrypted volume or delete it after the restore — never in a synced folder.
03

Check that the key really is inside

Open one file and look for the **keyMaterial** element. If it is empty, the export ran without elevation or the profile is enterprise-authenticated and has no local key.

Get-ChildItem C:\WifiBackup
gc C:\WifiBackup\Wi-Fi-MyNetwork.xml | Select-String -Pattern 'keyMaterial'
04

Import them on the new installation

**user=all** makes the profile available to every account on the machine, which is what you want for a home network the whole household uses.

Get-ChildItem C:\WifiBackup\*.xml | ForEach-Object {
  netsh wlan add profile filename=$_.FullName user=all
}
05

Fix the profile whose SSID changed

The internal name comes from the SSID at export time. Rename the network on the router and the profile has to be edited or added again under the new name.

netsh wlan show profile name="MyNetwork" key=clear
netsh wlan delete profile name="MyNetwork"
tipEdit the **name** element inside the XML before importing when the SSID changed but the key did not.
06

Confirm the connection and the key

After the import, connect once and read the profile back. A wrong key shows up as an authentication failure, not as a missing network.

netsh wlan connect name="MyNetwork"
netsh wlan show profile name="MyNetwork" key=clear | Select-String -Pattern 'Key Content|Authentication|Cipher'
Troubleshooting

Common issues

Export says the profile has no key

The shell is not elevated, or the network uses 802.1X enterprise authentication where the credential comes from the server, not the profile.

Import fails as not compatible

The file came from a newer Windows build with a profile schema the older system does not know. Import it on the target build or reconnect manually.

The profile exists but the machine will not join

Check the security type: WPA3-only fails on an adapter that only does WPA2. Read the Authentication line from the profile output.

Windows connects to the wrong network

Profiles have an order and priority. Set the preferred order under netsh wlan set profileorder, or delete the unwanted profile.

FAQ

Frequently asked

Is the XML portable to another PC?

Yes, on the same or a newer Windows build. The key is stored in a form both systems understand when exported with key=clear.

Does this work for a hidden network?

Yes. The profile keeps the hidden flag, so the machine joins without broadcasting a probe until it is in range.

How to undo this

Delete the exported files once the new install connects, and remove the folder C:\WifiBackup. Profiles can be removed again with netsh wlan delete profile name="MyNetwork".

Changelog · 1 entry
  1. 2026-10-31
    First version
Interactive version: checklist, feedback, related guides →

Free · no account needed · tracks your progress