How to Control Wireless Networks from Command Prompt in Windows

Do you think that only advanced users should use Command Prompt in Windows? That’s really not the case. You don’t have to be a techie to take advantage of the command line interpreter application to easily accomplish a variety of tasks including managing and controlling your wireless networks. This post shows you how you can do all that with the netsh tool.

Good to know: wondering when you should use Command Prompt over Powershell and vice versa? We highlight the differences.

1. View Wireless Network Profile

By default, Windows keeps track of the wireless network names and passwords of all the WLAN profiles used on your computer. With a single command, you can view the list of all wireless network profiles stored on your computer.

  1. Right-click on the Start menu and click “Run” from the list of options.
Clicking on "Run" from the WinX menu.
  1. In the Run dialog that appears, type cmd.exe on the drop-down box and click OK.
Typing "cmd.exe" in Run window.
  1. In the Windows terminal, type the following command to show all the saved profiles.
List of WLAN user profiles on your computer.
  1. To get detailed information about a specific profile, you can use the following command:
netsh wlan show profile name=[xyz]

Make sure you replace [xyz] with the name of your wireless network.

Requesting detailed information about specific profile in cmd.

2. Delete a Wireless Network Profile

Though Windows stores the details of all the in-use WLAN profiles, you don’t really need to hold on to your inactive profiles. For example, if you’ve relocated recently and changed your service provider, you can go ahead and remove the old profile(s.)

Use the following command to delete a profile:

netsh wlan delete profile name=[xyz]

Replace [xyz] with the name of the wireless network you wish to delete:

Netsh Delete Wlan Profile Command Windows

If the operation is successful, you should see a “Profile [profile name] is deleted from interface [name]” message appear below.

Note: make sure you use the show profile command first to determine whether you really want to have that particular WLAN profile deleted.

3. Export/Import Wireless Network Profiles

Exporting and importing network profiles will come in handy whenever there is a need to install the same WLAN profile on multiple computers. You can export all the wireless networks simultaneously or only a specific one.

  1. For exporting all the WLAN networks on your computer, use the following command:
netsh wlan export profile folder=[folder path] key=clear

Replace [folder path] with the path to the export destination folder. The XML files for all the profiles will be stored in the given folder.

Exporting all WLAN networks from PC via Command Prompt.
  1. To export a specific WLAN profile, add the name=[profile name] parameter:
netsh wlan export profile name=[profile name] folder=[folder path] key=clear
Exporting a WLAN profile via Command Prompt.
  1. Once the process is complete, you’ll see a message saying “Interface profile [profile name] is saved in file.” Take note of this particular file path. You might need it later.
  2. For importing a specific profile, use the following command:
netsh wlan add profile filename="[file path]"
Importing a specific WLAN profile via Command Prompt command.

where the [file path] should be replaced with the exact file path of the profile XML file.

Tip: need to transfer your Wi-Fi passwords from a Windows PC to another quickly? Here’s how you can do that.

4. See Wi-Fi Network Password

Do you need to connect a new device on your wireless network, and you misplaced the Wi-Fi password? You can view your WLAN profile’s network security key or password using the netsh tool.

  1. Type the following command in cmd and press Enter:
netsh  wlan show profile name=xyz key=clear

Replace “xyz” with the name of the WLAN profile for which you need to retrieve the password.

Typing command in cmd to view WLAN profile password.
  1. In the profile information displayed on the screen, look for the field “Key Content” under the section “Security settings”. The value displayed on the field is the password for connecting to the Wi-Fi network.

5. Stop Auto Connection of a Network Profile

Unless you have deselected the “Connect automatically” option while setting up a Wi-Fi connection, your PC will automatically connect to the Wi-Fi network as soon as it is powered on.

If you don’t want that to happen, you can change the connection mode for any WLAN profile to “manual” from Command Prompt.

  1. Type this command while making sure you replace [xyz] with the name of the network in question.
netsh wlan setprofileparameter name=[xyz] connectionmode=manual
Netsh Wifi Profile Change Connection Mode
  1. You should see the message “Profile [profile name] on interface [name] updated successfully.”

6. Generate a Wireless Network Report

If there is an issue with your wireless network and you need to connect with remote support, you can generate the WLAN report from Command Prompt and share that with them.

Note: to generate the WLAN report, you’ll need administrator privileges.

  1. Open a Run dialog, type cmd and press Ctrl + Shift + Enter keys together on your keyboard.
  2. Type the following command and press Enter.
netsh wlan show wlanreport
Typing "wlanreport" command in cmd.
  1. After a few seconds, the report will be generated in HTML format, and the path will be displayed on the Command Prompt window.
Report view in Command Prompt.

In addition to many technical details, the WLAN report also shows the graphical summary of your Wi-Fi network with details like connection/disconnection status at various sessions and the possible reasons for the session failures.

FYI: Wi-Fi issues are almost inevitable on a Windows PC. Here’s how you can get rid of them in record time.

Learn All You Need to Know About Your Wi-Fi Networks

Network shell (netsh) is a useful command allowing you to learn detailed information about the network profiles stored on your computer and customize their settings. If you need to reconnect to a Wi-Fi network that has been inactive for a long time, this tool will provide you with convenient access to its details. You can use the detailed network report generated by this tool to investigate slow Wi-Fi connection in your house.

Image credit: Unsplash All screenshots by Meenatchi Nagasubramanian

Meenatchi Nagasubramanian
Meenatchi Nagasubramanian

Meenatchi is always passionate about learning new technological advancements and would love to try out new gadgets, software, and apps. After quitting her career as an Embedded Software Developer in 2009, she took up a career in content writing.

Subscribe to our newsletter!

Our latest tutorials delivered straight to your inbox

Leave a Reply

Your email address will not be published. Required fields are marked *