Using Netsh Commands for Wi-Fi Management in Windows 8
In today's Server Tutorial we'll reveal how to efficiently manage wireless networks with Netsh WLAN commands in newer Windows operating system releases.
Among the many GUI changes starting with Windows 8, Microsoft removed some networking settings and functionality. However, most of these can still be accessed via the command-line interface (CLI), which is where the Netsh WLAN commands come into play.
Managing Wireless Networks
Starting with Windows 8, Microsoft removed the Manage Wireless Networks option in the Network and Sharing Center. Thus you can’t see a list of all the wireless profiles saved in Windows, nor easily remove or change them.
In Windows 8 you can remove or change wireless profiles by right-clicking the Wi-Fi network from the list of nearby networks, but only when you’re within range of that particular network. In Windows 8.1 this right-clicking ability was removed, leaving you without any way to remove or modify network settings via the GUI.
Thankfully there are at least the following Netsh, or network shell, WLAN commands that allow you to access the Wi-Fi profiles:
Show the list of wireless profiles:
netsh wlan show profiles
Retrieve the stored key (WPA, WEP, etc) of a profile:
netsh wlan show profiles name=[profile name] key=clear
Delete a wireless profile:
netsh wlan delete profile name=[profile name]
Set a network’s priority:
netsh wlan set profileorder name=[profile name]interface=[interface_name] priority=1
Stop automatically connecting to a network:
netsh wlan set profileparameter name=[profile name] connectionmode=manual
Though you can’t actually make changes to the network profiles themselves, you can export a desired profile, make changes to the XML file, and then import the profile back onto the same machine or another one.
In Windows 8, Microsoft also removed the ability to save/export the network profiles from the GUI in the Wireless Network Properties box under the Connection tab. However, it’s still possible via Netsh commands:
Export a wireless network profile:
netsh wlan export profile name=[profile name]
Import a network profile:
netsh wlan add profile filename=[path_and_filename.xml] interface=[interface_name]
Creating an Ad Hoc Wireless Connection
Starting with Windows 8, Microsoft also removed the ability to create ad hoc or peer-to-peer wireless networks. You won’t find the "Set up a wireless ad hoc option" under "Set up a new connection or network" anymore in the GUI. However, you can utilize what Microsoft calls Wireless Hosted Networks via Netsh commands:
Configure the Wireless Hosted Network:
netsh wlan set hostednetwork mode=allow ssid=[your_virtual_network_name] key=[your_network_password]
Enable the Wireless Hosted Network:
netsh wlan start hostednetwork
Disable the Wireless Hosted Network:
netsh wlan stop hostednetwork
Retrieve the Wireless Hosted Network details:
netsh wlan show hostednetwork
Change the password:
netsh wlan refresh hostednetwork YourNewNetworkPassword
Before users on the ad hoc network can access the Internet via the Wireless Hosted Network, you must enable Internet Connection Sharing (ICS). Open the Network and Sharing Center, open the Network Connections, right-click the network adapter that’s connected to the Internet, and select Properties.
Then select the Sharing tab, check Allow other network users to connect through this computer’s Internet connection, and then choose the Wireless Hosted Network Connection from the drop-down listbox, and click OK.
Going Beyond CLI for Network Configuration in Windows 8.1
Instead of using the Netsh commands via the CLI, you can alternatively download a utility that configures these networks for you, such as Connectify.
Eric Geier is a freelance tech writer — keep up with his writings on Facebook. He's also the founder of NoWiresSecurity, a cloud-based Wi-Fi security service, and On Spot Techs, an on-site computer services company.
Read more on "Server OS Spotlight" »