I am unable to connect to Wi-Fi using command prompt. I want to connect to Wi-Fi using command prompt as per my requirement. I can't use GUI controls or any other third party tools for this purpose
Here is what I am doing:
- I am adding the wi-fi profile using command:
netsh wlan add profile filename="PATH_TO_FILE.XML" interface="Wi-Fi"
Wi-Fi profile file looks like:
<?xml version="1.0"?>
<WLANProfile xmlns="http://www.microsoft.com/networking/WLAN/profile/v1">
<name>WiFi-ProfileName</name>
<SSIDConfig>
<SSID>
<hex>12346692D57617477617331</hex>
<name>WiFi-SSID</name>
</SSID>
<nonBroadcast>true</nonBroadcast>
</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>true</protected>
<keyMaterial>KEY_IS_REMOVED_TO_SHOW_THE_FILE_OF_THE_CONTENT_HERE</keyMaterial>
</sharedKey>
</security>
</MSM>
</WLANProfile>
- To connect to Wi-Fi network using I am using command:
netsh wlan connect ssid="WiFi-SSID" name="WiFi-ProfileName" interface="Wi-Fi"
After running this command, command prompt is showing a message that Connection request was completed successfully, but machine is not connecting the Wi-Fi at all.
Am I missing some setting to set any kind of permission or its something else?