Last Update: Sep 04, 2024 | Published: Feb 26, 2019
Except for wireless profiles that are automatically configured by an organization, it can be useful to back up profiles so that they can be restored, along with passwords, if users switch to a different device. Today I’ll show you how to use the netsh command-line tool to display, back up, and restore wireless network profiles.
Let’s start by listing the profiles configured on a device. Open a command prompt window and run the command line shown below.
netsh wlan show profiles
You’ll see a list of any profiles configured using Group Policy and those configured by the user. If you want more information about a profile, add its name to the command line.
netsh wlan show profile name="Starbucks"
Now let’s back up all the profiles on the device and their passwords. Each profile is backed up to a separate .xml file prefixed with ‘WiFi-‘.
netsh wlan export profile key=clear folder=c:temp
Using the command above, passwords are stored in clear text. If you want to export profiles with encrypted passwords, remove key=clear from the command:
netsh wlan export profile folder=c:temp
But if you remove key=clear from the command, you won’t be able to use netsh to restore the profile with the password. Exporting profiles with passwords in clear text can be useful if you want to quickly copy or set up a profile to another device but don’t know the Wi-Fi password.
You can export a specific profile by adding its name:
netsh wlan export profile "contosowifi" key=clear folder=c:temp
Now that you have exported one or more wireless network profiles, you can use netsh to add those profiles to a system. The command below adds the contoso wireless profile for all users.
netsh wlan add profile filename="c:tempWiFi-contoso.xml" user=all
If you want to add a profile just for the current user, change the user parameter to current.
netsh wlan add profile filename="c:tempWiFi-contoso.xml" user=current
When you add a profile, you will be able to see it in the list if you run netsh wlan show profiles again. If the network is in range, the device will automatically connect.