Here, I will show my mini project where I built a desktop app with Python customtkinter and pyinstaller. Introduction: However, sharing a QR code isn't always an option. For example, the connected device might be nowhere near the router. Imagine my Device A was previously connected to Wi-Fi 'XYZ' in Indonesia, but I am currently in Japan with that device. My friend in Indonesia wants to connect their Device B to that same 'XYZ' network. Since my device isn't currently within range of the signal, I can't simply generate a 'Share Wi-Fi' QR code. Need a way to view the saved password. Problem: Solve: solution without entering manual script to cmd. Please use this guide as intended for personal use or for helping friends or family to access networks you already have permission to use. And always be cautious when sharing Wi-Fi passwords. If you run this command on Windows cmd: netsh wlan show profiles

This will list all the device's connected Wi-Fi profiles ๐Ÿ‘‡.

To display the password, simply add this: netsh wlan show profiles name="<profile_name>" key=clear | findstr Key

Now we know how to retrieve the password, but only for single profile. Easily, we just need to loop the given list of profiles. In Python, we need to use import subprocess library. import subprocess from subprocess import CalledProcessError

def get_all_connected_wifi_profile() -> list[str]: command = f"netsh wlan show profiles" try: all_wifis = subprocess.check_output(command, shell=True, stderr=subprocess.STDOUT).decode("utf-8") except UnicodeDecodeError: all_wifis = subprocess.check_output(command, shell=True, stderr=subprocess.STDOUT, encoding="latin-1") except CalledProcessError as e: print(f"Error: {e}") print(f"Command output: {e.output.decode('utf-8').strip()}")

profiles = [ line.split(":")[1].strip() for line in all_wifis.split("\n") if "All User Profile" in line ] return profiles

def get_password(name: