Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Win11] Add Profile Method Fails #16

Open
guy-keller opened this issue Mar 12, 2023 · 0 comments
Open

[Win11] Add Profile Method Fails #16

guy-keller opened this issue Mar 12, 2023 · 0 comments

Comments

@guy-keller
Copy link

Python 3.11
Windows 11 Pro 22H2

Code sample:

winwifi.WinWiFi.add_profile(WIFI_NAME)
winwifi.WinWiFi.connect(WIFI_NAME, PASSWORD, True)

Stack trace:

  File "C:\dev\workspace\personal\DataExtractor\main.py", line 21, in connect_to_wifi
    winwifi.WinWiFi.add_profile(WIFI_NAME)
  File "C:\dev\workspace\DataExtractor\Lib\site-packages\winwifi\main.py", line 141, in add_profile
    cls.netsh(['wlan', 'add', 'profile', 'filename={}'.format(path)])
  File "C:\dev\workspace\DataExtractor\Lib\site-packages\winwifi\main.py", line 98, in netsh
    return subprocess.run(
           ^^^^^^^^^^^^^^^
  File "C:\Python311\Lib\subprocess.py", line 569, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['netsh', 'wlan', 'add', 'profile', 'filename=C:\\Users\\guike\\AppData\\Local\\Temp\\tmpz50k3zi1']' returned non-zero exit status 1.

Process finished with exit code 1

Checked the tmpz50k3zi1 file and it has one line only containing the WIFI_NAME value.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant