Windows Commands to Get the wifi Key


This trick works to recover a Wi-Fi network password (aka network security key) only if you've previously attached to the Wi-Fi in question using that very password. In other words, it only works if
you've forgotten a password.

It works because Windows 8 and 10 create a profile of every Wi-Fi network to which you attach. If you tell Windows to forget the network, then it also forgets the password, so this won't work. But most people never explicitly do that.

It requires that you go into a Windows Command Prompt with administrative privileges. To do so, use Cortana to search for "cmd" and the menu will show Command Prompt; right-click that entry and select "Run as administrator." That'll open the black box full of white text with the prompt inside—it's the line with a > at the end, probably something likeC:\WINDOWS\system32\>. A blinking cursor will indicate where you type. Start with this:

netsh wlan show profile

The results will bring up a section called User Profiles—those are all the Wi-Fi networks (aka WLANs, or wireless local area networks) you've accessed and saved. Pick the one you want to get the password for, highlight it, and copy it. At the prompt below, type the following, but replace the Xs with the network name you copied; you only need the quotation marks if the network name has spaces in it.

netsh wlan show profile name="XXXXXXXX" key=clear

In the new data that comes up, look under Security Settings for the line "Key Content." The word displayed is the Wi-Fi password/key you are missing.

On macOS, open up the Spotlight search (Cmd+Space) and type terminal to get the Mac equivalent of a command prompt. Type the following, replacing the Xs with the network name.

security find-generic-password -wa XXXXX


Comments :