1

I have been trying to connect to a wireless, secure network using command line.

The simple part works, connecting to a saved network:

C:\>netsh wlan connect name=NAME 
Connection request was completed successfully.

However when I disconnect from this network and "forget" the network, I can't seem to find out how to regain connection.

I tried the following commands:

 C:\>netsh wlan add profile filename="Test.xml" interface="Wireless Network Connection" user=current

If I'm correct this is wrong and only imports the "Text.xml" profile, which is non-existant. Is there any way how I can connect to a network which doesn't have a profile yet? Or is there a way to create profiles in the command line?

1 Answer 1

1
Syntax

add profile filename= PathAndFileName [[interface=]InterfaceName] [[user=]{all|current}]
Parameters

Filename
Required. Specifies both the path to, and name of the XML file containing the profile data.

And heres the file you need to create for your network

<?xml version="1.0" encoding="US-ASCII"?>
<WLANProfile xmlns="http://www.microsoft.com/networking/WLAN/profile/v1">
    <name>SampleWPA2PSK</name>
    <SSIDConfig>
        <SSID>
            <name>SampleWPA2PSK</name>
        </SSID>
    </SSIDConfig>
    <connectionType>ESS</connectionType>
    <connectionMode>auto</connectionMode>
    <autoSwitch>false</autoSwitch>
    <MSM>
        <security>
            <authEncryption>
                <authentication>WPA2PSK</authentication>
                <encryption>AES</encryption>
                <useOneX>false</useOneX>
            </authEncryption>
        </security>
    </MSM>
</WLANProfile>

Fill in your details in the appropriate fields.

You must log in to answer this question.

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