Last Updated on February 25, 2024 by Mathew Diekhake

I want to change my user password directly from the command line in Windows. Is it possible? Resolution:

The following tutorial demonstrates how to change the user password in the command line when using a version of the Windows operating system.

There are two types of accounts you can use with Windows: A local account for the computer only and a Microsoft account that can be used across computers. Many people, including Windows professionals, still want to use local user accounts for numerous reasons. One reason you might want the local user account is that, unlike the Microsoft account, it doesn’t require an internet connection. If you choose to use a local account, you can use the Command Prompt to update its password.

How to Change User Password in Windows Command Line

You can change your user password from the command line with the net user command in Windows. Here is how to do that:

Notes:

  • You will need administrator privileges before you can make changes to the password of a user account from the command line. This means you will need to run the elevated Command Prompt window. The tutorial below details how to do so.
  • If you have multiple words that make up the username, you will need to use an underscore to connect them for CMD to recognize the name. If you leave a space between the names, CMD will only recognize the first name as the username.

1. Open the elevated Windows Terminal app and then select the PowerShell shell from the menu. See this tutorial for how to open the elevated version of the Windows Terminal app: How to Open Elevated Windows Terminal as Administrator in Windows 11 [Tutorial].

2. To Change Local User Password in CMD

If you do not mind the password being shown on the computer’s display when you change it in the Command Prompt, you can use the command below:

a. From the top of the Terminal window, select the Command Prompt shell.

b. Type the following command into the command line and then press the Enter key on your keyboard to execute it:

net user loginid newpassword

Note: Change where it says “loginid” with the actual login ID and where it says “newpassword” with the password you want to use as the new password for the account.

Terminal\CMD\net user command

c. You can now close the Command Prompt and continue using the computer.

3. To Change Local User Password in CMD (Hidden)

If you want the password you set to be hidden from the computer’s display when you change it, you can use the command below instead:

a. From the top of the Terminal window, select the Command Prompt shell.

b. Type the following command into the command line and then press the Enter key on your keyboard to execute it:

C\>net user loginid *

Terminal\CMD\net user command (hidden)

c. When you use the asterisk, the Command Prompt will prompt you to enter your password, and when you do, it will not be printed on the screen this time. Additionally, it will make you repeat the password to give you an extra layer of security just in case you mistyped.

d. You can now close the Command Prompt and continue using the computer.