0
1
I'm running a portable hotspot on my phone. I wanted to connect to it using batch, so I created a profile file, added it as a profile with netsh and tried to connect. Netsh claims the request was completed successfully, even when the password is incorrect or the hotspot is disabled. It never actually connects.
I tried turning the wifi interface off and on again, disconnecting my Ethernet cable, and re-adding the profile. Nothing changed.
>netsh wlan connect name="null" interface="wi-fi"
Connection request was completed successfully.
<?xml version="1.0"?>
<WLANProfile xmlns="http://www.microsoft.com/networking/WLAN/profile/v1">
<name>null</name>
<SSIDConfig>
<SSID>
<hex>6E756C6C</hex>
<name>null</name>
</SSID>
</SSIDConfig>
<connectionType>ESS</connectionType>
<connectionMode>manual</connectionMode>
<MSM>
<security>
<authEncryption>
<authentication>WPA2PSK</authentication>
<encryption>AES</encryption>
<useOneX>false</useOneX>
</authEncryption>
<sharedKey>
<keyType>passPhrase</keyType>
<protected>false</protected>
<keyMaterial>12345678</keyMaterial>
</sharedKey>
</security>
</MSM>
<MacRandomization xmlns="http://www.microsoft.com/networking/WLAN/profile/v3">
<enableRandomization>false</enableRandomization>
</MacRandomization>
</WLANProfile>
According to the help section for 'netsh wlan connect', the command should only act like this if the device is already connected to that network. That's not the case here.