How to control Wi-Fi networks from Command Prompt on Windows 11

Windows 11 manage wireless networks
Windows 11 manage wireless networks (Image credit: Future)

On Windows 11, it's possible to view and manage wireless networks through Command Prompt, and in this guide, you will learn how. While you can use the Settings app to configure network settings quite easily through a user-friend interface, you can perform more advanced tasks using commands. For instance, you can recover the password of any profile saved on the device. You can view rich details about a specific profile or adapter and create reports to troubleshoot and solve common connectivity problems.

Regardless of the reason, Windows 11 (similar to previous versions) includes the "Network Shell" (netsh) command tool that features the "wlan" option to view, configure, and troubleshoot wireless networks.

This how-to guide will walk you through the most interesting commands to manage wireless with "netsh" on Windows 11.

How to view wireless profiles on Windows 11

To create a list of the wireless profiles stored on Windows 11, use these steps:

  1. Open Start.
  2. Search for Command Prompt, right-click the top result, and select the Run as administrator option.
  3. Type the following command to view the Wi-Fi network profiles stored on your computer and press Enternetsh wlan show profiles

(Image credit: Future)
  1. Type the following command to show the available network interfaces on the computer and press Enter: netsh interface show interface
  2. Type the following command to view the profiles for a specific interface and press Enternetsh wlan show profiles interface="WLAN-NAME"

In the command, replace the "WLAN-NAME" with the adapter's name. You can use the "netsh interface show interface" command to find the exact name. For instance, this command shows the profile for the "Wi-Fi" interface: netsh wlan show profiles interface="Wi-Fi"

(Image credit: Future)

Once you complete the steps, the command will print the profiles stored on Windows 11.

How to view wireless driver details on Windows 11

To generate a list of the driver information for the wireless adapter on Windows 11, use these steps:

  1. Open Start.
  2. Search for Command Prompt, right-click the top result, and select the Run as administrator option.
  3. Type the following command to view the wireless profiles stored on the computer and press Enternetsh wlan show drivers

(Image credit: Future)

After you complete the steps, the netsh command will print the driver details, including vendor, version, radio type (802.11ax, 802.11a, 802.11n, etc.), wireless authentication support, and other relevant information.

How to view wireless adapter features on Windows 11

To understand the capabilities of the wireless adapter, use these steps:

  1. Open Start.
  2. Search for Command Prompt, right-click the top result, and select the Run as administrator option.
  3. Type the following command to view the adapter capabilities and press Enternetsh wlan show wirelesscapabilities

(Image credit: Future)

Once you complete the steps, you will have a better understanding of the features supported by the adapter.

How to view wireless adapter configuration on Windows 11

To understand the current configuration of the network adapter, use these steps:

  1. Open Start.
  2. Search for Command Prompt, right-click the top result, and select the Run as administrator option.
  3. Type the following command to view Wi-Fi settings and press Enternetsh wlan show interfaces

(Image credit: Future)
  1. (Optional) Type the following command to show the available network interfaces on the computer and press Enternetsh interface show interface
  2. Type the following command to view the settings for a specific interface and press Enternetsh wlan show interface name="WLAN-NAME"

In the command, replace the "WLAN-NAME" with the adapter's name. You can use the "netsh interface show interface" command to find the exact name. For instance, this command shows the profiles saved for the "Wi-Fi" interface: netsh wlan show interface name="Wi-Fi"

(Image credit: Future)

After completing the steps, the command will display the adapter settings, including name, description, physical address, SSID, radio type, security authentication method, transmission rates, and signal strength.

How to view wireless security key on Windows 11

To check the wireless security key with commands, use these steps:

  1. Open Start.
  2. Search for Command Prompt, right-click the top result, and select the Run as administrator option.
  3. Type the following command to view the Wi-Fi network profiles stored on your computer and press Enternetsh wlan show profiles
  4. Type the following command to view the wireless password and press Enternetsh wlan show profile name="PROFILE-NAME" key=clear

In the command, replace the "PROFILE-NAME" with the profile name. For instance, this command shows the password for the tsunami network: netsh wlan show profile name="tsunami" key=clear

(Image credit: Future)

Once you complete the steps, the command will print the network security key in clear text for the specified profile.

How to prevent wireless automatic connection on Windows 11

To prevent your computer from connecting to a wireless network automatically, use these steps:

  1. Open Start.
  2. Search for Command Prompt, right-click the top result, and select the Run as administrator option.
  3. Type the following command to view the Wi-Fi network profiles stored on your computer and press Enternetsh wlan show profiles
  4. Type the following command to turn off auto-connect and press Enternetsh wlan set profileparameter name="PROFILE-NAME" connectionmode=manual

In the command, replace "PROFILE-NAME" with the name of the wireless profile. For instance, this command turns off automatic connections for the "tsunami" network: netsh wlan set profileparameter name="tsunami" connectionmode=manual

(Image credit: Future)

After you complete the steps, the system will stop trying to connect to wireless networks automatically.

How to change wireless connection priority on Windows 11

To change the connection priority of a Wi-Fi connection, use these steps:

  1. Open Start.
  2. Search for Command Prompt, right-click the top result, and select the Run as administrator option.
  3. Type the following command to view the Wi-FI network profiles and adapter information stored on your computer and press Enternetsh wlan show profiles
  4. Type the following command to change the network priority and press Enternetsh wlan set profileorder name="PROFILE-NAME" priority="PRIORITY-NUMBER" interface="ADAPTER-NAME"

In the command, replace "PROFILE-NAME" with the wireless profile name you want to change the priority. Also, specify the priority number, such as "1" to set the highest priority, and change "ADAPTER-NAME" for the name of the adapter. For instance, this command makes the "tsunami" profile a priority: netsh wlan set profileorder name=tsunami priority=1 interface="Wi-Fi"

(Image credit: Future)

Once you complete the steps, the command will set the new priority for the wireless network. 

How to delete wireless profile on Windows 11

To delete a Wi-Fi profile on Windows 11, use these steps:

  1. Open Start.
  2. Search for Command Prompt, right-click the top result, and select the Run as administrator option.
  3. Type the following command to view the Wi-Fi network profiles stored on your computer and press Enternetsh wlan show profiles
  4. Type the following command to delete a network profile and press Enternetsh wlan delete profile name="PROFILE-NAME"

In the command, replace "PROFILE-NAME" with the name of the wireless profile. For instance, this command deletes the "tsunami" profile: netsh wlan delete profile name="tsunami"

(Image credit: Future)

After you complete the steps, the command will remove the wireless profiles from Windows 11.

How to export wireless profiles on Windows 11

Although Windows 11 can sync the wireless network profiles to the cloud and across devices when setting up an account with a Microsoft account, it's also possible to export and import your files using the netsh command.

Export wireless settings

To export the wireless settings through Command Prompt, use these steps:

  1. Open Start.
  2. Search for Command Prompt, right-click the top result, and select the Run as administrator option.
  3. Type the following command to export the wireless profiles stored on the device and press Enternetsh wlan export profile key=clear folder="FOLDER-PATH"

In the command, replace "FOLDER-PATH" with the path to export the profile. For instance, this command exports the profiles to the "wlan-profiles" folder: netsh wlan export profile key=clear folder="C:\Users\user\Documents\wlan-profiles"

(Image credit: Future)
  1. (Optional) Type the following command to export a specific profile and press Enternetsh wlan export profile name="PROFILE-NAME" key=clear folder="FOLDER-PATH"

In the command, replace the "PROFILE-NAME" with the profile name you want to export and the "FOLDER-PATH" with the folder location to export the information. For instance, this command exports only the "tsunami" profile to the "wlan-profiles" folder: netsh wlan export profile name="tsunami" key=clear folder="C:\Users\user\Documents\wlan-profiles"

Once you complete the steps, the command will export the Wi-Fi profiles to the specified path as an XML file for each profile. The "key=clear" option will store the security key as clear text.

Import wireless settings

To import the Wi-Fi settings with commands, use these steps:

  1. Open Start.
  2. Search for Command Prompt, right-click the top result, and select the Run as administrator option.
  3. Type the following command to import the wireless profiles and press Enternetsh wlan add profile filename="FOLDER-PATH"

In the command, replace "FOLDER-PATH" with the path and file name for the exported file. For instance, this command imports a specific profile from the "wlan-backup" folder: netsh wlan add profile filename="C:\Users\user\Documents\wlan-profiles\Wi-Fi-tsunami.xml"

(Image credit: Future)
  • Quick tip: If you have multiple profiles, you must repeat the steps but update the file path and filename of the exported profile.
  1. (Optional) Type the following command to import a profile to a particular wireless interface and current user and press Enternetsh wlan add profile filename="FOLDER-PATH\WLAN-EXPORTED-FILE" Interface="INTERFACE-NAME" user=current

In the command, change "FOLDER-PATH" for the exported file's path and name containing the profile information and "INTERFACE-NAME" with the interface name to import the settings. For instance, this command imports the settings to the Wi-Fi interface: netsh wlan add profile filename="C:\Users\user\Documents\wlan-profiles\Wi-Fi-tsunami.xml" Interface="Wi-Fi" user=current

After you complete the steps, the profile will import into the system, and you can use it to connect to the wireless network without extra steps.

How to create wireless adapter report on Windows 11

To create a report of the wireless adapters, use these steps:

  1. Open Start.
  2. Search for Command Prompt, right-click the top result, and select the Run as administrator option.
  3. Type the following command to create a wireless adapter report and press Enternetsh wlan show wlanreport

(Image credit: Future)
  1. Type the following command to open the report and press EnterC:\ProgramData\Microsoft\Windows\WlanReport\wlan-report-latest.html

Once you complete the steps, the wireless report will open in your web browser.

The report contains visuals of the connectivity status, including information such as when the connection started, when it got disconnected, errors, and more. In the report, you will also find details about the network adapters' information, successful and failed sessions, disconnect reasons, and more. The wireless report includes valuable details to help you troubleshoot many connectivity issues.

How to connect wireless network manually on Windows 11

To connect to the Wi-Fi network manually with commands, use these steps:

  1. Open Start.
  2. Search for Command Prompt, right-click the top result, and select the Run as administrator option.
  3. Type the following command to disconnect from the wireless network and press Enternetsh wlan disconnect
  4. Type the following command to allow the system to connect to a wireless network and press Enternetsh wlan connect name=PROFILE-NAME

(Image credit: Future)

After you complete the steps, the command will connect or disconnect the device from the wireless network. If you're connecting to a network, in the command, make sure to specify the name of the profile for the network you're trying to establish a connection.

More resources

For more helpful articles, coverage, and answers to common questions about Windows 10 and Windows 11, visit the following resources:

Mauro Huculak

Mauro Huculak is technical writer for WindowsCentral.com. His primary focus is to write comprehensive how-tos to help users get the most out of Windows 10 and its many related technologies. He has an IT background with professional certifications from Microsoft, Cisco, and CompTIA, and he's a recognized member of the Microsoft MVP community.