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

Forgetting passwords for wireless networks is a common problem faced by users of operating systems of the family Windows of varying age. It often happens that a laptop or desktop computer automatically connects to the home network, and the owner conveniently forgets the access key. When it becomes necessary to connect a new device, a guest's smartphone, or restore the router, the lack of a saved password becomes a serious obstacle.

Fortunately, the operating system Windows stores profiles of all networks successfully connected to in a secure system registry. This data doesn't simply disappear, even if you change your router or update your drivers. There are several ways to extract this information, but the most reliable and fastest method is to use the built-in system tool— Command line or consoles PowerShell.

This method doesn't require installing third-party software, eliminating the risk of system infection by viruses or data miners. All necessary utilities are already built into the system kernel and are accessible to users with administrator rights. In this article, we'll detail the steps you need to take to quickly restore access to lost data.

Launch the console with administrator rights

Executing system commands related to network settings and security profiles requires elevated privileges. Simply launching the command prompt in user mode will not allow access to the password vault, as this is a critical security area of ​​the operating system. Therefore, the first step should always be to launch the terminal as an administrator.

There are several ways to open the desired interface. The fastest option is to press a key combination. Win + X in the Start menu and select "Windows PowerShell (Admin)" or "Windows Terminal (Admin)". An alternative method is to search through the Start menu: type cmd or Command line, then in the right part of the window, select the option “Run as administrator”.

⚠️ Note: If you attempt to run commands without administrator rights, the system will return an access error, and instead of a password, you will see a message stating that the operation was denied. Make sure your account has the appropriate rights.

Once the console window has successfully launched, you'll see a black or blue background with a blinking cursor. The interface may vary depending on the version. Windows 10 or Windows 11, but the functionality remains identical. The interface is now ready to accept control codes for working with network adapters.

☑️ Check before you start

Completed: 0 / 4

Viewing a list of saved networks

Before extracting a specific password, you need to ensure that the desired network profile is actually saved in the system. Your computer may have connected to hundreds of access points in cafes, offices, and public places, and it's important to identify the one you're currently interested in. To do this, use the list profiles command.

Enter the following command into the console and press the key Enter:

netsh wlan show profiles

The system will process the request and display a list of all saved profiles. At the top of the window, you'll see the heading "User Profiles," and below that, a list of network names (SSIDIf the network you're looking for a password for isn't on this list, it means your computer has never connected to it, or the profile was previously deleted.

Parameter Description Significance for the team
Interface Network adapter name Wi-Fi / Wireless network
Profile Name of the saved network Your network name (SSID)
Team Query syntax netsh wlan show profiles
Result List of available profiles Text output in the console

Please ensure the network name is spelled correctly. Capitalization is important, and although the system generally treats names insensitively, it's best to copy the name exactly as it appears in the list to avoid syntax errors when entering your next query.

Displaying the network security key

Once you've verified the profile exists, you can proceed to obtaining the password. To do this, modify the previous command by specifying a specific network name and adding a parameter requiring the key to be displayed in cleartext. This is the main step of the procedure, the reason for all the previous steps.

Enter the command, replacing Network_name to the real name of your Wi-Fi:

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

It is important to follow the syntax: if the network name contains spaces, it must be enclosed in quotation marks. Parameter key=clear is critical because it is what instructs the system to show the hidden security key, which is by default hidden by asterisks or dots in the GUI.

After pressing Enter The system will display a detailed profile report. Find the "Security settings" section. Inside this section, look for the "Key Content" line. The value displayed next to this line is the wireless network password you're looking for.

What to do if the key=clear parameter doesn't work?

In rare cases, administrators on corporate computers with strict security policies may block key display. This is almost never the case in a home environment. Also, make sure you enter the command for the network to which the computer is connected or has been connected.

Alternative method: export profiles to XML

Sometimes the text output in the console can be difficult to read or copy, especially if you need to save data for multiple networks. In such cases, the operating system Windows allows you to export profile settings to a file format XMLThis file will contain the entire configuration, including the cleartext password.

To perform an export, use the following construction:

netsh wlan export profile name="Network_Name" key=clear folder=C:\

This command will create a file with the extension .xml in the root of drive C. The file name will begin with the prefix "Wi-Fi" and contain the network name. Open this file with any text editor, for example With a notepad, you can find the tag keyMaterial, inside which the password will be written.

⚠️ Warning: XML password files contain sensitive information. After use, be sure to delete them or move them to a secure folder to prevent unauthorized access to your network.

The advantage of this method is the ability to export all profiles at once by removing the specific network name. However, for a one-time restoration of access to a single access point, it's easier to use the text output discussed in the previous section.

Resetting network settings and troubleshooting errors

In some cases, commands may fail to produce results or return an error if the operating system's network stack is not functioning properly. This can occur after driver updates, service failures, or software conflicts. If standard methods fail, resetting network settings may be necessary.

To reset network settings, you can use the command:

netsh int ip reset

After running this command, you must restart your computer. This will reset network protocols to factory defaults, which often resolves connection and profile display issues. However, keep in mind that you'll have to re-enter passwords for all Wi-Fi networks afterward.

📊 Have you encountered errors when entering commands in CMD?
Yes, there was a syntax error.
Yes, the system said "Access denied."
No, everything went smoothly.
I only use the graphical interface

It's also worth checking the Network Connection Manager (WlanSvc) service. It should be started and running in automatic mode. If this service is stopped, managing wireless networks via the command line will be impossible.

Security measures and data protection

Using the command line to view passwords is a powerful tool that demonstrates how easy it is to access stored data with physical access to the device and administrator privileges. Therefore, it's crucial to ensure your computer is securely protected from unauthorized access.

Basic safety recommendations:

  • 🔒 Account password: Never leave your computer on unattended unless you have a password set. Anyone who logs into your account will be able to find your Wi-Fi passwords.
  • 🛡️ User rights: Avoid using the administrator account for everyday tasks unless absolutely necessary. Restricting privileges reduces the risk of malware.
  • 🔄 Updates: Update regularly Windows and antivirus software to close vulnerabilities that could allow attackers to gain access to the system.
⚠️ Note: Router interfaces and operating system versions are subject to update. Some new security features may change the way keys are stored or displayed. Always check the official Microsoft documentation for the most current methods.

Remember that knowing your network password gives you complete control over your traffic. If you suspect someone has discovered your key, change it immediately in your router settings. To do this, connect to the device via cable or Wi-Fi and access the web interface using the address printed on the sticker on the bottom of the router.

Frequently Asked Questions (FAQ)

Is it possible to find out the password for a Wi-Fi network I've never connected to?

No, it is technically impossible to do this using the Windows command line. The command netsh Works only with profiles already saved in the computer's memory. If the device has never connected to the network, it has no data to display. To connect to a new network, you must know the password in advance or have access to the router.

Why does the command say "Access Denied"?

This error occurs in 99% of cases if the console is not run as an administrator. The operating system blocks access to critical network settings for standard users for security reasons. Restart the command prompt with administrator privileges.

Does this method work on Windows 7, 8, 10 and 11?

Yes, it is a utility. netsh has been a standard component of Windows for many years. The command syntax remains the same across all modern versions of the operating system, from Windows 7 up to date Windows 11The interface may differ slightly visually, but the functionality is identical.

Is it possible to find out someone else's network password if I'm nearby?

No, the described method only allows you to see passwords from networks to which your The computer has already been connected to in the past. Hack someone else's network or intercept a password over the air with a simple command. netsh It's impossible. This requires specialized tools and cybersecurity knowledge, and the process itself is illegal.

What if the network name contains special characters?

If the network name (SSID) contains spaces, quotation marks, or other special characters, be sure to enclose the name in double quotation marks when entering the command. For example: name="My Home Wi-Fi"If the name contains double quotes, they need to be escaped, but such cases are extremely rare.