Skip to content

[Win11] Add Profile Method Fails #16

Description

@guy-keller

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions