How to connect to a WiFi using CMD only?

17,189

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

Share:
17,189

Related videos on Youtube

Aravind .KEN
Author by

Aravind .KEN

Updated on September 18, 2022

Comments

  • Aravind .KEN
    Aravind .KEN over 1 year

    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++?

  • Menai Ala Eddine - Aladdin
    Menai Ala Eddine - Aladdin over 6 years
    Check this ,it is helpful for you [How can i connect to ad-hoc network using CMD? ](superuser.com/questions/1275646/…)