Question about lesson on course Learn Python & Ethical Hacking From Scratch

Hi!
On lecture about sending report by email you used code to get wifi passwords but you needed to specify wifi name.What if I don’t know the names of the wifis that the computer running the exe accessed before.How would I get all the information without knowing the name?

thank you

This only works on the Wi-Fi networks that you have connected to before. The password is shown because Windows stores the metadata for the wifi networks that you connected to before. You cannot do this for any network that you haven’t yet connected to.

Thank you Apurv-SationX