Open Command Prompt and run the password change command
The fastest way to change your Windows password from Command Prompt is to type net user followed by your username and a new password. Open Command Prompt (search "cmd" in the Windows search box), then type this command exactly:
net user [your username] [new password]
Replace [your username] with your actual Windows account name — the name that appears on your login screen. Replace [new password] with the password you want to use. Press Enter. If the command succeeds, you will see "The command completed successfully." Your password changes when ready.
If you do not know your Windows username, type whoami and press Enter. Command Prompt will display your full username, which you can then use in the net user command.
Key Takeaways
- The command net user [username] [newpassword] changes your Windows password directly from Command Prompt without opening Settings.
- You must run Command Prompt as administrator — right-click the Command Prompt icon and select "Run as administrator" — or the command will be rejected.
- Your new password takes effect when ready, and you will need it the next time you log in to Windows.
- If your password contains spaces or special characters, wrap it in quotation marks: net user username "new pass word"
- You cannot change another user's password this way unless you have administrator rights on the computer.
Run Command Prompt as administrator
Command Prompt must run with administrator permissions for the password change to work. If you do not run it as administrator, you will see the error "Access denied" when you try the net user command.
To open Command Prompt as administrator, search for "cmd" in the Windows search box. Right-click the "Command Prompt" result and select "Run as administrator." Windows will ask for permission — click "Yes." The Command Prompt window will open with "Administrator" in the title bar.
If you see a User Account Control dialog asking "Do you want to allow this app to make changes to your device?", click "Yes" to proceed. This is a security check and does not mean anything is wrong.
Handle passwords with spaces or special characters
If your new password contains spaces, hyphens, or symbols like ! or @, you must wrap the entire password in quotation marks. Without quotes, Command Prompt will interpret the space or symbol as the end of the password.
For example, if you want your password to be "Blue Sky 2024", type:
net user username "Blue Sky 2024"
The quotation marks tell Command Prompt to treat everything between them as a single password. Do not include the quotation marks as part of the actual password — they are only for the command itself.
Verify the password change worked
After you see "The command completed successfully," your password has changed. You do not need to restart your computer. The next time you log out and log back in, use your new password at the login screen.
If you want to test the password when ready without logging out, you can lock your computer by pressing Windows key + L, then try logging in with the new password. If it works, you are done. If it does not work, go back to Command Prompt and try the net user command again, making sure you typed the username and password correctly.
What to do if the command does not work
If you see "The system cannot find the file specified," you likely typed the username wrong. Use the whoami command to see your exact username, then try the net user command again with the correct spelling.
If you see "Access denied," Command Prompt is not running as administrator. Close it, right-click the Command Prompt icon, select "Run as administrator," and try again.
If you see "The password does not meet the password policy requirements," your new password is too straightforward. Windows requires passwords to be at least a certain length or contain a mix of uppercase, lowercase, numbers, and symbols, depending on your computer's settings. Try a longer password or one that includes numbers and symbols.
Alternatives if Command Prompt does not work for you
If you prefer not to use Command Prompt, you can change your password through Windows Settings. Press Windows key + I to open Settings, go to "Accounts," select "Sign-in options," and click "Password" to change it there. This method is slower but does not require typing commands.
If you have forgotten your current password and cannot log in, Command Prompt will not help you. You will need to use Windows password recovery options or contact your system administrator if this is a work computer.
Frequently Asked Questions
Can I change another user's password with this command?
Only if you have administrator rights on the computer. The command syntax is the same — net user [other username] [new password] — but you must be logged in as an administrator. You cannot change a password for a user account that has higher privileges than your own.
What happens if I forget the new password I just set?
You will not be able to log in. If you have another administrator account on the computer, log in with that account and use the net user command to set a new password for the first account. If you do not have another account, you will need to use Windows password recovery or contact your system administrator.
Do I need to restart Windows after changing my password?
No. The password change takes effect when ready. You only need to use the new password the next time you log in or lock and unlock your computer.
Will changing my password in Command Prompt affect my Microsoft account?
No. This command changes only your local Windows password. If you use a Microsoft account to sign in, you will need to change that password separately through the Microsoft account website.
Can I use this command on a work computer?
Only if your work computer allows it. Many workplaces restrict Command Prompt access or require passwords to meet specific rules set by the company. If the command is blocked, contact your IT department to change your password through their system.