Can't enable "Wi-Fi" interface via command line (Windows 10)

I'm trying to figure out how to enable the "Wi-Fi" interface in Windows 10, so that I can connect to a wireless network later using netsh wlan connect. After starting cmd with administrative privileges, netsh int show int correctly shows "Wi-Fi" as one of the interface names, and shows it as "disconnected".

However, when I try to enable it using netsh int set, it says "This network connection does not exist." As a test to see that the interface name is correct, I have been able to rename the "Wi-Fi" interface. The only way to enable it was by first turning on Wi-Fi via the Wi-Fi toggle switch in the Wi-Fi menu at the bottom right of the screen. If I don't do that, nothing works.

How would you make this work from the command line? I had a corrupted Windows 10 update once where explorer.exe wasn't working, as the system task bar wasn't there, so the not using the command line wouldn't really work out.


Solution 1:

This happens on my Win 7 virtual as well.

enter image description here

I do not know why this happens, however I know how to make the command work from command line.

Open Task Manager as admin (right-click 'Run As Admin'). Type the administrator password and click on 'Yes' , to proceed.

Click on New Task. Type in cmd in the Open: field

enter image description here

Make sure to check the box 'Create this task with admin privileges' Then click OK.

Your command window title will be prefixed with Administrator:

enter image description here

If you don't see administrator, then its not gonna work.

If it does run successfully, then its gonna look like this,

enter image description here

The name of the interface is changed here, because I don't have an interface called "Wi-Fi", please do change it accordingly.

Solution 2:

I found out the what was causing the problem. The "Wi-Fi" interface was already enabled. Trying to enable it twice causes the error message: "This network connection does not exist". However, this message doesn't print when already connected to a wireless network, it only prints when you aren't already connected to a wireless network. This would seem like a bug, as it makes the user think that enabling the interface had failed.

However, trying to connect to a wireless network using netsh wlan connect still doesn't work if the Wi-Fi toggle switch is not clicked in Windows 10. See follow up question: How to toggle Wi-Fi in Windows 10 via the command line?