awkman / pywifi

A cross-platform module for manipulating WiFi devices.
MIT License
453 stars 154 forks source link

Wlanapi Permissions bug on Windows 10 #71

Open MattCatz opened 2 years ago

MattCatz commented 2 years ago

I ran into the issue discussed here: https://docs.microsoft.com/en-us/answers/questions/397654/34netsh-wlan-connect34-wlanapiwlanconnect-from-wit.html

I am remoting into my Windows 10 machine using the built-in openssh server and running scripts that use pywifi. I purpose that we remove the WLAN_PROFILE_USER (0x2) from the call to WlanSetProfile https://github.com/awkman/pywifi/blob/719baf73d8d32c623dbaf5e9de5d973face152a4/pywifi/_wifiutil_win.py#L564-L570

swswswsml commented 2 years ago

I also encountered the same issue . I solved the issue with your commit. My service is Jenkins. I guess the issue is caused by the lack of permission of the windows user Jenkins logs in