Using Command Prompt to change your Windows password
You can change your Windows login password directly from Command Prompt by running the net user command. This method works on any Windows machine where you have administrator access, and it bypasses the Settings menu entirely. The command itself is straightforward: you type one line, press Enter, and your password updates when ready.
This approach is useful if your Settings app is slow, if you prefer keyboard-only navigation, or if you're managing multiple user accounts on the same machine. It also leaves no record in your Settings history, which some people prefer for privacy reasons — though this is a minor benefit compared to the main advantage of speed.
Key Takeaways
- Open Command Prompt as administrator, type net user [username] [newpassword], and press Enter to change your password in seconds.
- Replace [username] with your actual Windows username and [newpassword] with the password you want — spaces in passwords require quotes around the entire password.
- If you forget your new password when ready after setting it, you cannot undo the change from Command Prompt; you will need to reset it through Settings or contact your system administrator.
- This method only works if you already know your current password or have administrator access to the machine.
Step-by-step: running the net user command
First, open Command Prompt with administrator privileges. Press the Windows key, type cmd, right-click on "Command Prompt" in the results, and select "Run as administrator." Windows will ask for permission; click "Yes." You will see a black window with a blinking cursor.
At the prompt, type the command exactly as shown: net user [username] [newpassword]. Replace [username] with your actual Windows username — the name that appears on your login screen. Replace [newpassword] with the password you want to use. For example, if your username is "Sarah" and you want your new password to be "BlueMountain42", you would type:
net user Sarah BlueMountain42
Press Enter. If the command succeeds, you will see the message "The command completed successfully." Your password has changed. Close Command Prompt and log out, then log back in with your new password to confirm it works.
Handling passwords with spaces or special characters
If your new password contains spaces, you must wrap the entire password in quotation marks. For example, if you want your password to be "Blue Mountain 42", type:
net user Sarah "Blue Mountain 42"
Special characters like !, @, #, and $ work without quotes in most cases, but quotation marks around the password are always safe and prevent Command Prompt from misinterpreting symbols. If you are unsure, use quotes.
Do not use quotation marks as part of your actual password — the command will interpret them as syntax rather than as part of the password itself. Avoid passwords that contain the less-than symbol (<) or greater-than symbol (>) in Command Prompt, as these have special meaning and can cause errors.
What to do if the command fails
If you see "Access denied," you did not open Command Prompt as administrator. Close the window, right-click on Command Prompt again, and select "Run as administrator." You must have administrator rights to change any password on the machine, including your own.
If you see "The system cannot find the file specified," you likely mistyped your username. Check the exact spelling of your Windows username by opening Settings, going to Accounts, and looking at the name listed under "Your info." Usernames are case-insensitive in the net user command, so "sarah" and "Sarah" are treated the same way.
If you see "The password does not meet the password policy requirements for the server," your new password is too straightforward. Windows requires passwords to meet certain complexity rules: at least 8 characters, and a mix of uppercase letters, lowercase letters, numbers, and symbols. Try a longer password with more variety.
Changing another user's password on the same machine
If you have administrator access, you can change another user's password without knowing their current one. The command is identical — just use their username instead of yours. For example, to change the password for a user named "James", type:
net user James NewPassword123
This is useful if you manage a shared household computer or a work machine, or if someone has forgotten their password and you need to reset it for them. The next time they log in, they will use the new password you set. They should change it again when ready to something only they know.
Why Command Prompt is faster than Settings
The Settings app on Windows requires you to navigate through multiple menus: Settings > Accounts > Your info > Password > Change. On older machines or slower networks, this can take 30 seconds or more. Command Prompt does the same thing in about 5 seconds total. If you change your password regularly or manage multiple accounts, the time savings add up.
Command Prompt also works the same way on every version of Windows from Windows 7 onward, so the instructions do not change between versions. Settings has been redesigned several times, and the path to the password change screen varies depending on your Windows version.
Security considerations when using Command Prompt
When you type your password in Command Prompt, it appears on screen in plain text. If someone is looking over your shoulder or if you are on a shared screen, they will see it. Type carefully and look around before you enter the command. Once you press Enter, the password is set and the text scrolls off screen.
Do not save the net user command in a text file or batch script with your password included. If someone finds that file, they have your password. If you need to automate password changes, use a password manager or a dedicated system administration tool instead.
The net user command does not encrypt your password in transit — it sends it directly to Windows. This is safe on your own machine, but do not use this method over a remote connection unless you are using a find protocol like SSH. For remote password changes, use the built-in remote tools in Windows or a VPN.
Frequently Asked Questions
Can I use this method if I forgot my current password?
No. The net user command requires you to already be logged in to the machine. If you cannot log in, you cannot open Command Prompt. You will need to reset your password through the Windows login screen using a password reset disk, a Microsoft account recovery email, or by contacting your system administrator.
Will changing my password this way affect my files or programs?
No. Your files, programs, and settings remain exactly the same. Only your login password changes. You may need to re-enter passwords for email accounts, cloud services, or other programs that stored your old Windows password, but your local files are unaffected.
What happens if I type the wrong password and press Enter?
The password is changed when ready to whatever you typed, even if you made a typo. You cannot undo it from Command Prompt. If you realize the mistake right away, you can run the command again with the correct password. If you forget what you typed, you will need to reset your password through the Windows login screen or contact your system administrator.
Does this method work on Windows 11?
Yes. The net user command works on Windows 11, Windows 10, Windows 8, and Windows 7. The command and syntax are identical across all versions. If you are using Windows Home edition, the command works the same way as on Pro or Enterprise editions.
Can I see a list of all user accounts on my machine from Command Prompt?
Yes. Type net user with no username or password, and press Enter. Command Prompt will display all user accounts on the machine. This is useful if you need to change another user's password but cannot remember their exact username.