How to connect to a WiFi using CMD only?

Solution 1:

Unfortunately if you want to connect to a wireless network from command prompt that requires a passcode it won't happen.

First of all to connect to a wireless network with a password you need to setup a profile or you need to have an already set up profile you can check that profile by using

Netsh wlan show profiles

To see your profile you need to be connected to that wifi at least once .

The alternative way is to have a generated created xml profile and use the following command to connect to it :

netsh wlan connect ssid=YOURSSID name=PROFILENAME interface="WIRELESS NETWORK CONNECTION"

More info could be found here in this article