How to find your Wi-Fi password using the Windows 10 command line

It's common to find yourself in a situation where you urgently need to connect a new device to a wireless network but have forgotten the password for your current connection. Fortunately, the operating system Windows 10 stores all access keys ever entered in its memory, which allows you to restore them without the need for physical access to the router. command line is the fastest and most reliable method for extracting this information, without requiring the installation of third-party software.

Unlike the graphical interface, where the path to the password can be confusing, console commands provide direct access to system profiles. The netsh wlan show profile name="NetworkName" key=clear command is the main tool for displaying the saved security key. This method works reliably on most computers and laptops, regardless of the network card manufacturer or driver version, providing administrative access to network settings.

However, please note that performing such operations requires administrator rights. Without the appropriate permissions, the system will block the request to display sensitive data. Below, we'll detail the procedure, explore possible errors, and address them so you can restore access to your network without any problems.

📊 How do you usually store Wi-Fi passwords?
I'm recording on the router
I remember it by heart
I save it on my phone/cloud
I forgot and I look for it every time.

Preparing to work with the console and checking access rights

Before entering complex commands, you should launch the terminal with elevated privileges. Launching the command prompt in user mode by default will prevent the system from revealing saved passwords for security reasons. To do this, press the key combination Win + X and select the item Windows PowerShell (Administrator) or Command Prompt (Administrator) from the menu that appears.

If you prefer the classic search, type in the search box on the taskbar cmd"Command Prompt" will appear in the search results. Right-click on it and select the option Run as administratorConfirm the action in the User Account Control (UAC) window by clicking "Yes."

Once launched, you'll see a black window with a blinking cursor. Make sure the path is in the window title. C:\Windows\system32\cmd.exe and there's the "Administrator" prefix. This is a critical step, as without it, subsequent requests will return an access error.

View a list of all saved Wi-Fi profiles

The first step after launching the console is to get a list of all wireless networks your computer has ever connected to. Windows stores this data in the form of profiles, each of which contains the network name (SSID) and connection parameters. To display the list, use the command netsh wlan show profiles.

Enter the specified command and press Enter. The system will display a list of all profiles in the "User Profiles" section. If you've connected to multiple networks, the list may be long, so carefully search for the desired name. The network name must match the SSID of the router that distributes the internet.

netsh wlan show profiles

Please note the syntax: if your network name contains spaces or special characters, you will need to enclose the name in quotation marks when working with this profile. In the standard list, profiles are numbered for easier navigation, but to extract the password, we need the text network name.

☑️ Check before entering a command

Completed: 0 / 4

Extracting a specific network password using netsh

Once you've decided on a network name, the most important step comes. We need to query the system for detailed information about the selected profile, including the security key. This is done using the extended command syntax. netsh with parameter key=clear, which forces the hidden key to be displayed.

The command has the following structure: netsh wlan show profile name="Network_Name" key=clearPlease note that the network name must be enclosed in double quotation marks, especially if it contains spaces. If the name is a single word without spaces, quotation marks are technically not required, but using them is good practice to avoid syntax errors.

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

In the information window that opens, scroll down to the section Security parameters (Security settings). We're interested in the "Key Content" line. The value next to this line is your Wi-Fi password. Copy it or write it down.

⚠️ Attention: If you see an error message or a blank value instead of a password, make sure you're entering the profile name exactly as it appears in the list, including case.

Analysis of security parameters and encryption types

The profile information window contains not only the password, but also important technical details of the connection. In the security section, you will also find the encryption type (usually WPA2-Personal or WPA3) and authentication type. This data is useful for diagnosing compatibility issues with older devices.

Below is a table of the main parameters that can be seen in the command output, and their meaning for the user:

Parameter Description Meaning for the user
Profile name Network SSID Your Wi-Fi network ID
Connection type Infrastructure Connection via a router (standard)
Encryption WPA2 / AES Data protection protocol (must be WPA2)
Security key Password The required code to access the network

Having modern encryption standards ensures that your traffic is protected from interception. If you see an outdated standard WEP, it is highly recommended to change the security settings on your router, as such a password can be easily hacked even without access to your computer.

What to do if the encryption is WEP?

If WEP is listed in the settings, this is a warning sign. This protocol is outdated and provides no real security. We recommend immediately accessing the router settings and changing the security type to WPA2-Personal (AES), then reconnecting all devices with the new password.

Automating the process through batch files

For those who frequently need to recover passwords on different computers or are simply too lazy to enter long commands, there's a way to automate it. You can create a special script (batch file) that will perform all the steps for you. This is especially convenient for system administrators.

Create a text file, paste the command code into it, replacing the network name with a variable, or simply specify a specific network. Save the file with the extension .batHowever, a more universal option is to create a script that displays passwords for all saved networks at once.

@echo off

netsh wlan show profiles | find "Profile"

set /p ssid="Vvedite imya profilya: "

netsh wlan show profile name="%ssid%" key=clear

pause

Running such a file as an administrator will allow you to quickly access the required data. However, be careful with executable files obtained from untrusted sources, as they may contain malicious code disguised as useful utilities.

⚠️ Attention: Don't run .bat files downloaded from the internet unless you're sure of their contents. Open the file in Notepad and check the code before running.

Possible errors and methods for eliminating them

When working with the command line, users often encounter common errors. The most common ones are "Network not found in profile" or "Access denied." The former occurs when the profile name is misspelled or the letters are not capitalized correctly.

The second error, "Access Denied," indicates that the console is not running as an administrator. The problem could also be caused by antivirus software, which is blocking attempts by programs (in this case, cmd) to read system security keys. Temporarily disabling the protection or adding an exception may help.

Sometimes a profile can become corrupted. In this case, Windows will prompt you to forget the network and reconnect. To delete the problematic profile, use the following command: netsh wlan delete profile name="Network_Name"After this, you will need to re-enter the password when connecting.

Alternative ways to restore access

If the command line method doesn't work for some reason or seems too complicated, there are graphical methods. In Windows 10, you can find the password through the Network and Sharing Center. To do this, go to the wireless network properties, open the Security tab, and check the "Show characters" box.

Another option is to use third-party utilities such as WirelessKeyView from NirSoft. These programs automatically scan the registry and display all saved passwords in a convenient format. However, using third-party software always carries potential security risks, so the method cmd remains the most preferred choice for experienced users.

Also, don't forget about the physical sticker on the router. If you've never changed the factory settings, the password may be there. As a last resort, you can always reset the router to factory settings, but this will require reconfiguring the entire internet connection.

⚠️ Attention: Resetting your router will erase all your ISP settings. Use this method only if you have the necessary information to configure a PPPoE or L2TP connection.
Is it possible to find out someone else's Wi-Fi password?

Technically, if you've previously connected to the network, the password is saved in the system. However, using this data to access other people's networks without the owner's permission is illegal and violates computer security laws.

Frequently Asked Questions (FAQ)

Is it possible to find out a Wi-Fi password if the computer is not currently connected to this network?

Yes, you can. The command line accesses saved profiles in the Windows registry. If you've ever connected to this network and selected the "Connect automatically" option, the password is saved, even if you're currently located elsewhere in the world.

Why does the netsh command say "Query parameter not recognized"?

There's likely a syntax error. Check for spaces around the equal sign (there shouldn't be any) and make sure it's spelled correctly. key=clear and quotes around the network name. Commands are case-sensitive and punctuation-sensitive.

Does this method work on Windows 7 and 8?

Yes, team netsh wlan is standard for all modern versions of Windows, starting with Vista. The syntax remains unchanged, so the instructions are also relevant for older operating systems.

Where are these passwords physically stored?

Passwords are stored in a protected section of the Windows registry and in system configuration files. They are encrypted with a key linked to the user account and computer SID, making stealing a password file from another computer futile without additional effort.

What should I do if the required network is not in the list of profiles?

This means that this computer has never connected to this network, or the profile was previously deleted. In this case, it's impossible to recover the password from this PC; you'll have to find another device that connected or look up the password on the router.