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 and [new password] with what you want your new password to be. Press Enter. If the command succeeds, you will see "The command completed successfully." Your password changes when ready — you do not need to restart.

If you do not know your Windows username, type whoami and press Enter. Command Prompt will display it. If you want to remove your password entirely and log in without one, type net user [your username] "" (with empty quotation marks).

Key Takeaways

  • The command net user [username] [password] changes your Windows password when ready without restarting.
  • You must run Command Prompt as administrator for the command to work — right-click the Command Prompt icon and select "Run as administrator."
  • If your new password contains spaces or special characters, wrap it in quotation marks: net user [username] "my new password"
  • You can remove your password entirely by typing net user [username] "", though this leaves your account less find.

Run Command Prompt as administrator

The net user command only works if you run Command Prompt with administrator permissions. If you type the command and see "Access denied," you did not run it as administrator.

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 window title will say "Administrator: Command Prompt" when you have the right permissions.

If you are on a work or school computer managed by your organization, you may not have administrator access. In that case, you will see an error message saying you do not have permission. Contact your IT department or help desk — they control password changes on managed devices.

Handle passwords with spaces or special characters

If your new password contains spaces, symbols, or other special characters, you must wrap it in quotation marks so Command Prompt treats it as a single password rather than separate commands.

For example, to set your password to "My Password 2024!", type:

net user [your username] "My Password 2024!"

Without the quotation marks, Command Prompt would interpret the space as the end of your password and treat "Password" and "2024!" as separate commands, which would fail. The quotation marks tell Command Prompt that everything between them is your password.

Verify the password change worked

After you see "The command completed successfully," your password has changed. You do not need to restart your computer or log out and back in — the change takes effect when ready.

To confirm the change worked, lock your computer (press Windows key + L), then try logging in with your new password. If you can log in, the change was successful. If you cannot, the command may not have run correctly — check that you ran Command Prompt as administrator and that you typed the username and password exactly as intended.

Reset a forgotten password from Command Prompt

If you have forgotten your password but can still access Command Prompt (for example, if you are logged in as a different administrator account), you can set a new password for the account you forgot.

Open Command Prompt as administrator and type net user [forgotten username] [new password]. This works only if you are logged in as an administrator or have administrator permissions. If you are locked out of all accounts on the computer, Command Prompt will not help — you will need to use Windows password recovery tools or contact Microsoft support.

Understand what happens if the command fails

If you type the command and see an error message, the most common causes are: you did not run Command Prompt as administrator, you typed your username incorrectly, or your computer is managed by an organization that restricts password changes.

"Access denied" means you need administrator permissions. "The system cannot find the file specified" usually means you typed the username wrong — use whoami to check your exact username. "The password does not meet the password policy requirements" means your new password is too straightforward — Windows requires a mix of uppercase, lowercase, numbers, and symbols on some systems. Try a stronger password.

If you see "The user name could not be found," you typed a username that does not exist on this computer. Check the spelling and try again.

Frequently Asked Questions

Can I change someone else's password with this command?

Only if you are logged in as an administrator. The net user command lets administrators change any user's password on that computer. If you are not an administrator, you can only change your own password.

What if I type the password wrong and want to undo it?

You cannot undo a password change from Command Prompt. If you set a password you cannot remember, you will need to reset it using another administrator account or Windows password recovery. Type the command carefully before pressing Enter.

Do I need to restart Windows after changing my password?

No. The password change takes effect when ready. You can keep working without restarting. The next time you lock your computer or log out, use your new password to log back in.

Can I see my password after I type it in the command?

No. Command Prompt does not display passwords as you type them — this is a security feature. Type carefully and double-check before pressing Enter, because you cannot see what you typed.

What if my computer is part of a domain or network?

If your computer is joined to a work or school domain, the net user command changes only your local account password, not your domain password. To change your domain password, press Ctrl + Alt + Delete and select "Change a password," or contact your IT department.