How to connect to a WiFi using CMD only?

2

How to connect to a new WiFi by enter a password using CMD?

For my school project I have decided to make a WiFi_manager program using cmd.

I know to display all WiFi networks (in cmd):

netsh wlan show networks

Now lets say I want to connect to a WiFi network that I never connected before. And that WiFi is not added any profiles also.

But I know the password of the WiFi.

1) What will be the command line for that.

Given the information of WiFi network below:

SSID 3 : Ismail
    Network type            : Infrastructure
    Authentication          : WPA-Personal
    Encryption              : CCMP

and password is "Thanks_bro".

I search this question already in google but none of them say a right way and most of them are related to hacking and to connect a WiFi without password etc. So I posted this question to the BEST programmers out here to answer!

If not possible, can we do using C++?

Aravind .KEN

Posted 2016-12-16T14:16:45.490

Reputation: 99

Answers

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

Elie

Posted 2016-12-16T14:16:45.490

Reputation: 479

Check this ,it is helpful for you How can i connect to ad-hoc network using CMD?

– Xlint Xms – 2017-12-10T17:41:03.913