1

I am new to command prompt and I am learning it for about some weeks, I wanted to test myself by connecting to a newly bought wifi router, but in doing so I am facing some problems.

As far as I know to connect to a wifi network the command used is

netsh wlan connect name='profile' ssid='ssid' interface='interface'

But the problem i face is regarding the name(Profile). when I type the command

netsh wlan show profiles

The cmd shows me the profiles of the networks I have connected to before, but we require the name(profile) part to connect to a wifi network, so how can I connect to a network I have never connected before?

When I type the command

netsh wlan show networks mode=bssid

I can see a list of available networks and their BSSIDs also I can see my network's name there, but how do I connect to it? Also is there any way to connect to a network using the bssid or ssid of it. Please help me.

Screenshots of my progress so far.

Two pics one showing the available profiles while the other shows a failed attempt to connect with ssid (The second pic above shows a failed attempt to connect with the ssid)

The bssids of the available networks (The one encircled is our concern)

1 Answer 1

0

How can I connect to a wireless network I have never connected before?

Export an existing profile, modify xml as appropriate, import modified profile:

First you export an existing wifi profile:

netsh wlan export profile name="WifiNetwork" folder="C:\path\" key=clear

Then you get a XML file with the following style:

<?xml version="1.0"?>
<WLANProfile xmlns="http://www.microsoft.com/networking/WLAN/profile/v1">
<name>WifiNetwork</name>
<SSIDConfig>
    <SSID>
        <hex>123456789ABCDEF</hex>
        <name>WifiNetwork</name>
    </SSID>
</SSIDConfig>
<connectionType>ESS</connectionType>
<connectionMode>auto</connectionMode>
<MSM>
    <security>
        <authEncryption>
            <authentication>WPA2PSK</authentication>
            <encryption>AES</encryption>
            <useOneX>false</useOneX>
        </authEncryption>
        <sharedKey>
            <keyType>passPhrase</keyType>
            <protected>false</protected>
            <keyMaterial>Password123</keyMaterial>
        </sharedKey>
    </security>
</MSM>

Than you can modify this file and import it to add this wifi with this command:

netsh wlan add profile filename="C:\path\WifiNetwork.xml"

Source Add wlan profile with password in windows programmatically, answer by cSteusloff

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .