What Command Prompt can and cannot do with your router credentials

Command Prompt can show you the Wi-Fi network name and password your computer has already connected to, but it cannot retrieve your router's admin username and password directly. Those two are different things. The network password (what you type to join Wi-Fi) lives on your computer. The router admin credentials (what you type into 192.168.1.1 to change settings) live only on the router itself, and Command Prompt has no way to reach them.

If you have already connected to your Wi-Fi and forgotten the password, Command Prompt can recover it in about 30 seconds. If you have forgotten the admin login for the router itself, Command Prompt cannot help — you will need to reset the router or contact your internet provider.

Key Takeaways

  • Command Prompt can display the Wi-Fi password your computer remembers, but not the router admin username and password.
  • The command netsh wlan show profile name="YourNetworkName" key=clear reveals your saved Wi-Fi password on Windows.
  • If you have forgotten your router admin login, you must either reset the router to factory settings or contact your internet service provider.
  • Resetting a router erases all custom settings, so write down your Wi-Fi name and password before you reset.
  • The router admin login is not the same as your Wi-Fi password — they protect different things.

How to find your saved Wi-Fi password using Command Prompt

Open Command Prompt as administrator. On Windows 10 or 11, right-click the Start button, select "Windows Terminal (Admin)" or search for "cmd", right-click it, and choose "Run as administrator". You will see a black window with a cursor.

Type this command exactly, replacing "YourNetworkName" with the actual name of your Wi-Fi network:

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

Press Enter. Command Prompt will display information about that network. Scroll down to find the line that says "Key Content" — the text after that is your Wi-Fi password in plain text. This only works if your computer has connected to that network before. If the network name does not exist in your computer's memory, the command will return an error.

Why the router admin password is not stored on your computer

Your computer stores the Wi-Fi password because it needs to reconnect to the network automatically. The router admin password is different — it protects access to the router's settings, and your computer does not need to know it. Only the router knows it, and it is stored in the router's memory, not yours.

This is actually a security feature. If someone steals your computer, they can find your Wi-Fi password, but they still cannot change your router settings or see what devices are connected. The two passwords protect different things at different levels.

What to do if you have forgotten your router admin login

If you cannot remember the username and password you use to log into your router's settings page (usually at 192.168.1.1 or 192.168.0.1), you have three options.

Check the router itself. Most routers have a sticker on the back or bottom with the default username and password printed on it. The defaults are often "admin" and "admin", or "admin" and "password". If the sticker is still there and you have never changed the login, try those credentials.

Contact your internet service provider. Call the phone number on your bill. They can tell you the default login for your specific router model, or in some cases they can reset it remotely. This does not erase your Wi-Fi settings.

Reset the router to factory settings. Press and hold the small reset button on the back of the router for 10 to 15 seconds while it is powered on. The lights will blink and the router will restart. After it boots up, the admin login will be back to the factory default (usually printed on the sticker). However, this also erases your Wi-Fi network name, password, and any other custom settings you have made. Write down your Wi-Fi details before you reset.

The difference between Wi-Fi password and router admin login

The Wi-Fi password is what guests and devices type to connect to your network. The router admin login is what you type into a web browser to change settings like the Wi-Fi name, the Wi-Fi password, port forwarding, or parental controls. They are stored in different places and protect different things.

If someone knows your Wi-Fi password, they can use your internet. If someone knows your router admin login, they can change your Wi-Fi password, disconnect all your devices, or alter your network settings. This is why the router keeps the admin password separate — it is a higher level of access.

Why Command Prompt shows Wi-Fi passwords in plain text

Windows stores Wi-Fi passwords in a way that Command Prompt can read and display because your computer needs to use that password automatically. If the password were encrypted in a way your computer could not read, it could not reconnect to the network on its own. The trade-off is that anyone with access to your computer can also read it using the same command.

This is why physical security of your computer matters. If you leave your laptop unlocked in a public place, someone can open Command Prompt and see every Wi-Fi password your computer has ever connected to. If you share a computer with other people, they can see your passwords the same way. Consider this when deciding whether to use Command Prompt to recover a password on a shared device.

Frequently Asked Questions

Can I use Command Prompt to find my router admin password?

No. Command Prompt can only show passwords your computer has stored, and your computer does not store the router admin password. You will need to check the sticker on the router, contact your internet service provider, or reset the router to factory settings.

What if I type the command and get an error?

The most common reason is that you typed the network name wrong or your computer has never connected to that network. Make sure you spell the network name exactly as it appears in your Wi-Fi list, including capital letters and spaces. If you are sure the name is correct, your computer has no record of that password.

Does resetting the router erase my internet service?

No. Resetting the router only erases the settings stored on the router itself — your Wi-Fi name, password, and any custom configurations. Your internet service from your provider continues. You will need to reconnect to Wi-Fi using the default network name and password after the reset.

Is it safe to use Command Prompt to view my Wi-Fi password?

It is safe if you are the only person with access to your computer. If others use your computer, they can run the same command and see all your passwords. If you are on a shared or work computer, check your organization's policy before using this command.

What is the default router admin login?

It varies by router brand and model. Common defaults are "admin" and "admin", "admin" and "password", or "admin" and blank. Check the sticker on your router or your router's manual. If you have changed the login before and forgotten it, you will need to reset the router or contact your internet service provider.