WifiPasswordReveal: A script to reveal all the saved WiFi passwords in Windows 7 and above

Hello,

The “How to show saved Windows 7 Wifi passwords” turned out to be a popular article and to make the life of my readers easier, I decided to apply a newly acquired knowledge and write a tool to make it SUPER EASY to get all the saved WiFi passwords without needing administrative privileges and without having to click through various settings dialogs.

Note: In some cases, if the script fails to run, then you may want to run the script as administrator.

Read on! or download the script.

batchography-good-resIn the past few month, I have been busy writing my new book: “Batchography: The Art of Batch Files Programming” and along the way I learned various Batch files programming tricks!

To get the saved WiFi passwords, one can type two command lines and then scroll through the output to find the needed information. However, not all users are tech savvy and would be intimidated by the command prompt.

To save you from the trouble and relying on the knowledge from Chapters 2 and 3 in the Batchography book, I could easily write an elegant script that reveals all the saved passwords!

I would say that the Batchography book is really handy for solving day to day computer problems with little efforts.

I highly recommend getting this book because you can learn to write similar scripts and sharpen your technical skills.

By the way, you get the printed book from Amazon using this link here or the ebook using this link!

flower separator

If you don’t care about the details and the know-how, then skip to the end of the article to get the download information for the script!

How to do it manually from the command prompt

To get the saved WiFi passwords on the system, you have to issue two commands.

The first command is:

netsh wlan show profiles

It will output all the saved network profiles on the system, for example:

C:\Users\User>netsh wlan show profiles

Profiles on interface Wi-Fi:

Group policy profiles (read only)
---------------------------------
    <None>

User profiles
-------------
    All User Profile     : WifiNetwork1
    All User Profile     : WifiNetwork2
    All User Profile     : WifiNetwork3

Now that we have a bunch of network profile names, we will invoke a new command to get the key information about a saved profile:

C:\Users\user>netsh wlan show profile name="WifiNetwork1" key=clear

This command will output various information about the network but in particular the password, referred to as “Key Content”, if the WiFi network was password protected (as opposed to an open WiFi network):

Profile WifiNetwork1 on interface Wi-Fi:
=======================================================================

Applied: All User Profile

Profile information
-------------------
    Version                : 1
    Type                   : Wireless LAN
    Name                   : WifiNetwork1
    Control options        :
        Connection mode    : Connect manually
        Network broadcast  : Connect only if this network is broadcasting
        AutoSwitch         : Do not switch to other networks
        MAC Randomization  : Disabled

Connectivity settings
---------------------
    Number of SSIDs        : 1
    SSID name              : "WifiNetwork1"
    Network type           : Infrastructure
    Radio type             : [ Any Radio Type ]
    Vendor extension          : Not present

Security settings
-----------------
    Authentication         : WPA2-Personal
    Cipher                 : CCMP
    Authentication         : WPA2-Personal
    Cipher                 : Unknown
    Security key           : Present
    Key Content            : thepassword1

Cost settings
-------------
    Cost                   : Unrestricted
    Congested              : No
    Approaching Data Limit : No
    Over Data Limit        : No
    Roaming                : No
    Cost Source            : Default

The idea then is to repeat the previous command for each saved network profile to retrieve the password.

Using the WifiPasswordReveal script

It is very easy to use the WifiPasswordReveal script. Just download it:

Download WifiPasswordReveal

…and then run the Batch file that’s inside the zip archive you just downloaded.

Because you are trying to run an un-signed script from the Internet, you may get a prompt like this:

wifipasswordreveal-run-anyway

Just click “More info” and choose “Run anyway”.

Note: If you don’t trust my WifiPasswordReveal script and what it does, you can always read its source code from here or from inside the zip archive you just downloaded!

Here’s a sample output:

WifiPasswordReveal

Pretty straight forward!

The beauty of this is that you are not downloading any executable files that you don’t know what they do and most importantly you don’t need administrative privileges.

flower separatorYou might also like:

37 Replies to “WifiPasswordReveal: A script to reveal all the saved WiFi passwords in Windows 7 and above”

  1. The batch file uses the ‘netsh wlan show profiles’ command. You cannot acquire the password in plain text if you are not running this script as admin. The batch file executes without admin access, but it cannot acquire the security key without admin access. So, this is useless if one is not signed in as admin.

    1. Well, I tried it as non admin and so did my friends and it worked. I don’t know why it does not work with you.

    2. do a profile export instead. netsh wlan export profile. The password is encrypted if you are not admin but is should still work.

    1. It is hard to troubleshoot the script like this. If it does not work for you just follow the manual method as described in the blog post. First do “netsh wlan show profiles ” then pick a profie and call the other command “wlan show profile name=TheName key=clear” etc…Good luck!

      1. the syntax is netsh wlan show profiles “ProfileName” key=clear. try using netsh wlan show all instead. It gives you a lot more info.

  2. For all who are having problems, note that it will just work if you execute cmd as admin by rightclicking cmd.exe or your script and the choose the option “Run as Administrator” (It may be written diferent. My computer isn’t in English, but I think you will find the option by looking for a shield.).

    P.S. Sorry for my Bad English

    1. Edit it and remove the “pause” command accordingly. The Batchography book will explain how to understand Batch files.

    2. type PAUSE>NUL to do a quit pause and TIMEOUT /T 5 FOR A COUNTDOWN AND CONTINUE. YOU CAN ALSO USE >NUL WITH TIMEOUT AS WELL SO YOU DON’T SEE THE COUNTDOWN. THE 5 IS FOR SECOUNDS. YOU CAN CHANGE THAT NUMBER TO ANYTHING YOU LIKE

  3. My UVerse Modem has an asterisk in the wi-fi password/key.
    The downloadable script did not work properly. It gave an error … ‘*’ is not recognized as an internal or external command” … and only showed part of the key.
    However, it did show surrounding network keys correctly.

    1. That’s a weird corner case! I suggest you follow the “manual method” in the other articles mentioned in that article.

      1. It is hard to tell like that. I am not sure the “&” needs to be escaped. The best way to debug the script is to turn off the “@echo off” line at the beginning of the script. Otherwise, just follow the manual steps described in the article.

  4. When i run the command “NETSH WLAN SHOW PROFILES”
    the result is “user profiles” NONE.

    but when i run the command “NETSH WLAN SHOW networks”
    It shows :-
    Interface name : Wi-Fi
    There are 8 networks currently visible.

    SSID 1 : SABRY
    Network type : Infrastructure
    Authentication : WPA2-Personal
    Encryption : CCMP

    and so on all the 8 networks.
    Tel me how to get passwords of these available networks.

  5. Hello,
    thanks for this batch.
    Your script works only with password that does not contain special characters such as $*÷” etc. Is there any way to provide compatibility with these special characters?
    It also works on Windows 10.

    1. Thanks for the report Ralph. I will investigate the script. Meanwhile, I would suggest you try to follow the manual instructions from the command line.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.