netshnetsh wlan export profile Command: Export Wi-Fi Profiles
Learn how to use netsh wlan export profile to back up Wi-Fi profiles, export passwords safely, and migrate wireless settings across Windows devices.
The netsh wlan export profile command exports saved Wi-Fi profiles from a Windows machine into XML files so you can back them up, migrate wireless settings, or audit configurations. Use it to export one profile or all profiles, optionally including the Wi-Fi password in clear text with key=clear when you have administrator access.
Whether you are an IT professional preparing a workstation migration, a system administrator documenting network access for compliance, or a power user moving to a new laptop, this command provides a reliable, scriptable way to preserve wireless configurations. It is also a practical tool for incident response when you need to capture network settings before making changes.
This guide covers netsh wlan export profile syntax, parameters, detailed examples, safe handling of exported XML files, troubleshooting common errors, related commands, FAQs, and a quick reference card. By the end, you will confidently export Wi-Fi profiles for backup, automation, and migration workflows.
What Is the netsh wlan export profile Command?
netsh wlan export profile is a Windows Command Prompt command that exports one or more saved Wi-Fi profiles into XML files. Each XML file includes settings such as SSID, authentication type, encryption method, and connection preferences. When you include key=clear, the exported XML also contains the Wi-Fi password in readable text, which is useful for migrations but sensitive for security.
The command works in Windows 7 through Windows 11 and Windows Server editions that include wireless networking. It runs inside the wlan context of netsh and requires administrative privileges when exporting passwords.
Syntax
netsh wlan export profile [name="PROFILE_NAME"] [folder="PATH"] [key=clear]
Parameters and Options
| Parameter | Description | Example |
|---|---|---|
name="PROFILE_NAME" | Exports only the specified profile | name="OfficeWiFi" |
folder="PATH" | Saves XML files to a specific folder | folder="C:\WiFi" |
key=clear | Includes Wi-Fi password in clear text | key=clear |
If you omit name=, netsh exports all saved Wi-Fi profiles on the system. If you omit folder=, netsh saves XML files in the current working directory.
Parameters Explained
Profile Name (name="PROFILE_NAME")
Use name= when you need to export a single Wi-Fi profile. This is the safest option for targeted migrations and minimizes sensitive data output.
netsh wlan export profile name="OfficeWiFi"
Output Folder (folder="PATH")
Use folder= to control where XML files are saved. This is essential for scripted backups, shared storage, or structured evidence collection.
netsh wlan export profile name="OfficeWiFi" folder="C:\WiFi"
Include Password (key=clear)
Add key=clear to include the Wi-Fi password in the exported XML. This is convenient for migration, but it creates sensitive artifacts that must be protected.
netsh wlan export profile name="OfficeWiFi" key=clear
Examples (HowTo)
1. Export a single profile to the current folder
Scenario: You want a quick backup of one Wi-Fi profile before reinstalling Windows.
netsh wlan export profile name="HomeWiFi"
Expected output:
Profile "HomeWiFi" is saved in file "Wi-Fi-HomeWiFi.xml" successfully.
Explanation: Netsh creates an XML file in the current directory with all settings for the selected profile.
2. Export all profiles to a specific folder
Scenario: You are migrating a laptop and want to back up every saved network.
netsh wlan export profile folder="C:\WiFiBackup"
Expected output:
Profile "OfficeWiFi" is saved in file "C:\WiFiBackup\Wi-Fi-OfficeWiFi.xml" successfully.
Profile "GuestWiFi" is saved in file "C:\WiFiBackup\Wi-Fi-GuestWiFi.xml" successfully.
Explanation: Netsh exports all saved profiles to the specified folder, one XML file per network.
3. Export a profile with password in clear text
Scenario: You need to move a Wi-Fi profile to a new machine and want the password included.
netsh wlan export profile name="OfficeWiFi" folder="C:\WiFiBackup" key=clear
Expected output:
Profile "OfficeWiFi" is saved in file "C:\WiFiBackup\Wi-Fi-OfficeWiFi.xml" successfully.
Explanation: The XML file contains a <keyMaterial> element with the Wi-Fi password. Treat it as sensitive data.
4. Export all profiles with passwords (admin only)
Scenario: You are doing a fleet migration and need credentials for each SSID.
netsh wlan export profile folder="C:\WiFiBackup" key=clear
Expected output:
Profile "OfficeWiFi" is saved in file "C:\WiFiBackup\Wi-Fi-OfficeWiFi.xml" successfully.
Profile "MobileHotspot" is saved in file "C:\WiFiBackup\Wi-Fi-MobileHotspot.xml" successfully.
Explanation: This exports all profiles and includes passwords. Restrict access to the folder.
5. Export, then verify saved profiles
Scenario: You want to confirm which profiles exist before export.
netsh wlan show profiles
netsh wlan export profile name="OfficeWiFi" folder="C:\WiFiBackup"
Expected output:
User profiles
-------------
All User Profile : OfficeWiFi
All User Profile : GuestWiFi
Explanation: netsh wlan show profiles lists saved SSIDs so you can reference the exact profile name.
6. Export a profile from a script with timestamped folder
Scenario: You want a repeatable backup process for audit and compliance.
set BACKUP_DIR=C:\WiFiBackup\%DATE:~10,4%-%DATE:~4,2%-%DATE:~7,2%
mkdir "%BACKUP_DIR%"
netsh wlan export profile folder="%BACKUP_DIR%"
Expected output:
Profile "OfficeWiFi" is saved in file "C:\WiFiBackup\2026-05-06\Wi-Fi-OfficeWiFi.xml" successfully.
Explanation: This creates a dated folder and exports all profiles for historical tracking.
7. Export and check password in XML (read-only inspection)
Scenario: You need to verify a password but do not want to edit the XML.
netsh wlan export profile name="OfficeWiFi" folder="C:\WiFiBackup" key=clear
Open the file and locate:
<keyMaterial>yourPasswordHere</keyMaterial>
Explanation: The password appears in the XML only when key=clear is used with admin privileges.
Common Use Cases
-
Laptop migrations – Export profiles before moving to a new device so Wi-Fi reconnects without manual setup.
-
Enterprise imaging – Capture known-good profiles for deployment to standardized builds.
-
Disaster recovery – Preserve Wi-Fi configurations before OS rebuilds or recovery workflows.
-
Field technician kits – Preload profiles for customer locations to reduce on-site setup time.
-
Compliance evidence – Document wireless configuration for security audits or change management logs.
-
Incident response – Snapshot current profiles before troubleshooting or remediation steps.
-
Password recovery (authorized) – Recover SSID credentials when the primary record is lost but the machine is authorized.
-
Scripted backups – Automate regular exports for historical tracking of network changes.
-
Guest network separation – Identify and remove stale or insecure profiles by inspecting exported XML.
-
Remote support – Ask users to export profiles and send XML for analysis instead of screen sharing.
Tips and Best Practices
-
Run as administrator when exporting passwords –
key=clearrequires elevation or it may omit the key. -
Restrict access to export folders – Treat XML files like credentials; store them in secured paths.
-
Use exact profile names – Copy the SSID from
netsh wlan show profilesto avoid errors. -
Prefer single-profile exports – Export only what you need to minimize sensitive output.
-
Document export context – Record hostname, date, and reason for export in logs for compliance.
-
Sanitize files before sharing – Remove
<keyMaterial>if you must send XML externally. -
Avoid public folders – Do not export passwords to shared locations or cloud sync folders.
-
Backup before deleting profiles – Export profiles before running cleanup commands.
-
Use consistent naming conventions – Keep export folders consistent across teams and scripts.
-
Verify results – Check that XML files exist and are readable after export.
Troubleshooting Common Issues
"The system cannot find the file specified"
Problem: Netsh returns an error when exporting to a folder.
Cause: The target folder does not exist or the path contains a typo.
Solution: Create the folder first and use quotes around paths with spaces.
mkdir "C:\WiFi Backup"
netsh wlan export profile folder="C:\WiFi Backup"
Prevention: Validate the folder path and use quotes for paths with spaces.
"Access is denied"
Problem: Export fails or key=clear does not include the password.
Cause: Command Prompt is not running as Administrator, or folder permissions block writing.
Solution: Run CMD as Administrator and ensure the destination folder is writable.
Prevention: Always elevate when using key=clear and use a local folder with proper permissions.
"Profile not found"
Problem: Netsh says the profile does not exist.
Cause: The profile name does not match exactly, or the profile was never saved.
Solution: List profiles and copy the exact name.
netsh wlan show profiles
Prevention: Use exact SSID names and avoid trailing spaces in the command.
XML file exists but no password
Problem: The export succeeds, but <keyMaterial> is missing.
Cause: key=clear was not used, or the user lacks administrative rights.
Solution: Re-run with key=clear from an elevated prompt.
Prevention: Use a standard operating procedure for password-inclusive exports.
Wireless interface not available
Problem: Netsh reports no wireless interface on the system.
Cause: Wi-Fi adapter is disabled, missing, or the machine does not support wireless.
Solution: Enable the adapter or run on a system with Wi-Fi capability.
netsh interface show interface
Prevention: Confirm Wi-Fi adapter status before exporting profiles.
Related Commands
netsh wlan show profiles
Lists all saved Wi-Fi profiles on the system. Use this to identify exact profile names before export.
netsh wlan add profile
Imports a Wi-Fi profile from XML on a new machine: netsh wlan add profile filename="Wi-Fi-OfficeWiFi.xml".
netsh interface show interface
Shows adapter status and helps confirm Wi-Fi is enabled before exporting.
ipconfig
Quickly verifies network configuration after migration or profile changes.
ping
Validates connectivity once the exported profile is imported and connected.
Frequently Asked Questions
What does netsh wlan export profile do?
It exports saved Wi-Fi profiles to XML files, including SSID, security settings, and connection preferences. With key=clear, it also includes the Wi-Fi password in readable form.
Can I export all Wi-Fi profiles at once?
Yes. Omit name= and netsh exports all profiles: netsh wlan export profile folder="C:\WiFiBackup".
Does key=clear always show the password?
Only if you run Command Prompt as Administrator and the profile contains a stored key. Otherwise the password is omitted.
Where are the XML files saved?
If you use folder=, files are saved there. Otherwise they are saved in the current working directory.
Is it safe to share exported profiles?
Only if you remove <keyMaterial> or avoid key=clear. Password-inclusive XML files are sensitive and should be secured.
Can I import these profiles on another PC?
Yes. Use netsh wlan add profile filename="Wi-Fi-SSID.xml" on the target machine.
Does this work in PowerShell?
Yes. Netsh works from PowerShell exactly as it does from CMD.
How do I list the available profile names?
Run netsh wlan show profiles and copy the SSID names exactly.
Why does export fail with "access denied"?
You likely need to run the terminal as Administrator or write to a folder that requires elevated permissions.
Quick Reference Card
| Command | Purpose | Example |
|---|---|---|
netsh wlan show profiles | List saved profiles | netsh wlan show profiles |
netsh wlan export profile name="SSID" | Export one profile | netsh wlan export profile name="OfficeWiFi" |
netsh wlan export profile folder="C:\WiFi" | Export all profiles | netsh wlan export profile folder="C:\WiFi" |
netsh wlan export profile name="SSID" key=clear | Export with password | netsh wlan export profile name="OfficeWiFi" key=clear |
netsh wlan add profile filename="Wi-Fi-SSID.xml" | Import profile | netsh wlan add profile filename="Wi-Fi-OfficeWiFi.xml" |
CTA: Practice and Explore
Practice netsh commands in the Windows Command Simulator to build confidence before running changes on production machines. Browse the full Commands Reference for networking tools like netsh, ipconfig, and ping. Learn more about this project on the About page.
Summary
The netsh wlan export profile command is the most reliable way to back up or migrate saved Wi-Fi profiles in Windows. Use name= for single exports, folder= for organized output, and key=clear when you need passwords included and can protect the resulting files. Exported XML files make migrations faster, troubleshooting easier, and documentation more accurate for IT professionals and enterprise workflows.
Treat exported profiles as sensitive data, especially when passwords are present. Run the command from an elevated terminal, store XML files in protected folders, and sanitize files before sharing. Combined with netsh wlan add profile, this export workflow gives you a complete, scriptable method for managing Wi-Fi configurations across machines.