Command Line to Enable Network Connection on Windows

A user has reported that she could not connect to the wireless network anymore: the wireless connection appeared to be disabled. I first asked the user to check the wireless switch on the front of the laptop and make sure the switch was turned on. This was first suggested because the switch can sometimes be accidentally flipped, and I have seen this happen a couple of times already. The user reported the switch was set to the “on” position, so that was not the cause.

The wired connection was still working, so I could connect to it remotely and work on the problem. I sent an email asking for a good time to work on the problem because I wanted to use Remote Desktop, which would require the user to log off the machine. Before I got a reply from the user, I decided to logon to the machine using psexec /h \\machinename cmd.exe first and see if I could enable the wireless connection without interrupting the user.

After playing with netsh command a bit, I finally found the correct command syntax to enable the wireless network connection. The complete command is

netsh interface set interface name="Wireless Network Connection" admin=enabled

Note that you have to replace Wireless Network Connection with the name of the disabled network connection on your machine. If you are not sure about the name of the network connection, you can use the netsh command to find that out. Here is the command and the output.

>netsh interface show interface

Admin State  State         Type       Interface Name
-------------------------------------------------------------------------
Enabled      Connected     Dedicated  Local Area Connection
Disabled     Disconnected  Dedicated  Wireless Network Connection
Enabled      Connected     Dedicated  Cisco AnyConnect VPN Client Connection

Please see the screenshot below for the netsh interface command.

 


This post may contain affiliated links. When you click on the link and purchase a product, we receive a small commision to keep us running. Thanks.


2 Comments

  1. Hi,

    I got a problem.

    I got a user who was able to connect wireless in school but just not able to connect at all at home.

    I have tried everything like checking the wlan autoconfig and replaced another wifi card and ram but nothing works at home.

    when i did netsh interface show interface, it showed admin state as enabled, state as disconnected, type as dedicated, interface name as Wireless Network Connection. So is there anything wrong with this ?

Leave a Reply