Command to change password in windows

on September 11, 2011

We can change a user password from Windows command line using net user command. The command is explained below with examples.

How to change local user password

net user  loginid  newpassword

For example, if you want to reset the password for the user John on the local computer, you can run the below command. Let’s say the new password is pq12d*12@

net user  John  pq12d*12@

You may not want to provide the new password in the command prompt for obvious security reasons. Net use command allows to reset the password so that none around your desk can see it. You need to provide * in the place of password while executing net use command. You will be prompted to type the password and the password you enter won’t be printed on the screen. But you need to feed the password twice to make sure that you have entered the password you intended to.

example:

C\>net user John *
Type a password for the user:
Retype the password to confirm:
The command completed successfully.

How to change domain user account password

If you want to change password for a domain account, you can do it by running the below command.

net  user  loginid  *  /domain

Next, you will be prompted twice to enter the password and on successful completion your domain account password will be reset. You can also provide the password in the command itself as explained above.

In case the domain is not reachable then you will get the below error when you try to run the above command.

System error 1355 has occurred.
The specified domain either does not exist or could not be contacted.

Related Posts:

  • Add new user account
  • Enable or disable user account

If you feel that the Login Password for your computer has been compromised, you will find below the steps to Change Windows 10 Password using Command Prompt and Settings.

Change Windows 10 Password Using Command Prompt

Depending on how the computer was initially setup or due to your own preference, you might be using either Local or Microsoft Account to login to your computer.

If you are using a Local Account, you can change the Login Password for your computer using Command Prompt and also by using Settings.

If you are using Microsoft Account to login to your computer, you can refer this guide: How to Change Microsoft User Account Password in Windows 10.

1. Change Windows Password Using Command Prompt (CMD)

If you prefer using Command Prompt, you can follow the steps below to change the login password on your computer.

Click on Start button and type Command Prompt in the Search bar. Right-click on Command Prompt in the search results and click on Run as Administrator option.

Open Command Prompt As Admin

In Command Prompt window, type net user Username NewPassword and press the Enter key.

Change Windows Password Using Command Prompt

Note: In above Command, replace Username with your actual User Name and NewPass with the New Password that you want to use.

Once this Command is successfully executed, you will be able to login to your computer using New Password.

Tip: If you do not know the Name of your User Account, type net user in Command Prompt window and press the Enter key. This will list the Names of all User Accounts on your computer.

2. Another Way to Change Windows Password Using Command Prompt

Open Command Prompt, type net user Username * > press Enter key > Type New Password and Retype the New Password to confirm.

Change Windows Password Using Net User Command

Note: In above command, replace Username with your actual User Name (Family in this case).

Once you Retype your New Password and press the Enter Key, the Login Password on your computer will be changed and replaced with the New Password.

The only problem with above Command is that you won’t be able to see anything when you Type and Retype your New Password.

3. Change Windows Login Password Using Settings

The simplest way to change the Login Password in Windows 10 is by going to Settings.

Go to Settings > Accounts > select Sign-in Options in the left pane. In the right pane, scroll down and select the Password option and click on the Change button.

Change Password Option in Windows

On Change your Password Screen, enter you Current Password and click on the Next button.

Confirm Current Password in Windows 10

On the next screen, enter your New Password, Reenter Password and click on the Next button.

Change Your Password Screen in Windows 10

Finally, click on the Finish button.

Finish Change Password Process in Windows 10

Now, you can login to your computer using the New Password.

  • How to Delete User Account In Windows 10
  • How to Disable User Accounts in Windows 10

Things You Should Know

  • To change a password in the Command Prompt, type «net user [username] [new password] and press «Enter.»
  • For a more discreet option, you can type «net user [username} *» and press «Enter.» Then enter the new password twice.
  • You must have administrative access to change a password using the Command Prompt.
  1. Image titled Change a Computer Password Using Command Prompt Step 1

    1

    Click the Windows Start menu

    Windows Start

    . It’s the icon with the Windows logo in the taskbar at the bottom of the screen.

  2. Image titled Change a Computer Password Using Command Prompt Step 2

    2

    Type CMD. This displays the Command Prompt in the Windows Start menu.

    • On Windows 8, you can bring up the «Search» bar by hovering your mouse in the top-right corner of the screen and clicking the magnifying glass when it appears.
    • If you’re using Windows XP, you’ll instead click the Run app on the right side of the Start menu.

    Advertisement

  3. Image titled Change a Computer Password Using Command Prompt Step 3

    3

    Right-click Command Prompt. It has an icon that resembles a black screen with a white cursor. Right-clicking it will invoke a drop-down menu.

    • If you’re using Windows XP, you’ll instead type cmd into the Run window.
  4. Image titled Change a Computer Password Using Command Prompt Step 4

    4

    Click Run as administrator. It’s near the top of the drop-down menu. Doing so will open Command Prompt with administrator privileges.

    • You’ll need to confirm this choice by clicking Yes when prompted.
    • If you’re using Windows XP, you’ll click OK to open Command Prompt.
  5. Advertisement

  1. Image titled Change a Computer Password Using Command Prompt Step 5

    1

    Type net user into the Command Prompt and press Enter. Make sure you include the space between the two words.

  2. Image titled Change a Computer Password Using Command Prompt Step 6

    2

    Find the name of the account you wish to edit. If you’re changing your own account password, it will be below the «Administrator» heading on the left side of the Command Prompt window; otherwise, the name will likely be beneath the «Guest» heading on the right.

    • You can also add a new user using the Command Prompt.
  3. Image titled Change a Computer Password Using Command Prompt Step 7

    3

    Type net user [username] * into Command Prompt and press Enter. You’ll need to replace «[username]» with the name of the account for which you wish to change the password. Type the account name exactly as it appears in the account name section of the Command Prompt.

    • If you instead see a group of lines that start with «The syntax of this command is:», type net user Administrator * in for an administrator account or net user Guest * for a guest account.
  4. Image titled Change a Computer Password Using Command Prompt Step 8

    4

    Type in a new password and press Enter. The cursor won’t move or show the password. This is to hide the password from anyone who may be looking.

  5. Image titled Change a Computer Password Using Command Prompt Step 9

    5

    Re-type your password and press Enter. Again, it won’t appear as you type, so take your time. Make sure you enter the password exactly as you entered it the first time.

    • For a quicker (but less discreet) option, type net user [username] [new_password] into the Command Prompt and press Enter. Replace «[username]» with the account name you wish to change the password for, and replace «[new_password]» with the password you want to set.[1]
    • You can also find your Wi-Fi password using the Command Prompt
  6. Advertisement

Add New Question

  • Question

    How do I remove a password using cmd?

    Community Answer

    Follow the steps listed above and when it prompts you to put in the password just press enter twice.

  • Question

    Will this work on Windows 8?

    Community Answer

    Yes, this will work in Windows 8 or Windows 8.1. With any Admin account, after right clicking the Start screen box in the bottom left corner(for Windows 8.1) (or by clicking the very left corner) and clicking Command Prompt (Admin), you can achieve the same box — just agree to the User Account Control box by clicking the OK button from the dialog box. Otherwise, stay with the same process from that point forward.

  • Question

    I bought a computer from someone and now I can’t reach him. There are two administrator passwords. How can I remove the administrators and passwords on what is now my computer?

    Community Answer

    If you’re on Windows 8/10, press and hold Shift key while you’re clicking on Restart in Power Options. It will show a Recovery menu. There press advanced, command prompt, and wait. You need to type the same commands listed in the guide. Basically this is an admin command prompt, so you should have the privilege to change the admin password.

See more answers

Ask a Question

200 characters left

Include your email address to get a message when this question is answered.

Submit

Advertisement

  • If you do not have an administrative account, you will need to contact an administrator to have your password changed.

  • If the PC you are trying to log into has a BIOS password, you will either need the master password to reset the BIOS password, or you can remove the CMOS battery from the motherboard.

Thanks for submitting a tip for review!

Advertisement

  • Never change the password on a computer for which you don’t have permission to do so.

Advertisement

About This Article

Article SummaryX

1. Open the Command Prompt.
2. Type «net user [username] *» and press Enter.
3. Enter the new password and press Enter.
4. Enter the password again and press Enter.

Did this summary help you?

Thanks to all authors for creating a page that has been read 1,920,856 times.

Is this article up to date?

On Windows 10, if you suspect your password has been compromised, it’s a weak password, or if you have been using the same password for a long time, it is a good practice to change your Windows 10 account password to something different and difficult for someone else to guess.

If you have a local account without a Microsoft account, there are multiple ways to change your password, but one quick way is to use Command Prompt.

In this guide, you will learn the steps to change your local account password on Windows 10.

To change your local account password with Command Prompt, use these steps:

  1. Open Start on Windows 10.

  2. Search for Command Prompt, right-click the top result, and select the Run as administrator option.

  3. Type the following command to view all the available accounts and press Enter:

    net user
  4. Type the following command to change the account password and press Enter:

    net user USERNAME *

    In the command, make sure to change USERNAME with the account name you want to update.

    Command Prompt change account password

    Command Prompt change account password
  5. Type a new password and press Enter.

  6. Type the new password again to confirm and press Enter.

Once you complete the steps, sign out and sign back into the Windows 10 account to start using the new password.

The steps outlined above won’t apply if you have an account linked to your Microsoft account. In this case, you need to follow these steps to change your account password.

Although this guide focuses on Windows 10, these steps should also work on Windows 8.1 and Windows 7.

We may earn commission for purchases using our links to help keep offering the free content. Privacy policy info.

All content on this site is provided with no warranties, express or implied. Use any information at your own risk. Always backup of your device and files before making any changes. Privacy policy info.

Here’s how to use the «net user» command line option to quickly change a password in Windows.

Command line interface with cartoon people sitting around it working on laptops

Need to change a user password in Windows 10 or 11? You can do this through the Settings app, but it’s much faster and takes fewer clicks to change a password through the command line instead.

Even if you’re new to text commands on Windows, changing the user password with the net user command is simple. We’ll show you how to change a Windows password using the command line with this handy method.

Use the Net User Command to Change a Windows Password

To change another Windows user’s password via the command line, you need administrator privileges. See how to check if your Windows account is an admin if you’re not sure. If you aren’t using an admin account because you’ve lost your administrator password and can’t make any changes, follow our tips for resetting a lost Windows admin password.

Also, keep in mind that this method only works for local accounts in Windows 10 and 11. It won’t work if you use a Microsoft account to sign in to Windows; you’ll need to change the password using Microsoft’s web account management page instead. See our guide to securing your Microsoft account for help with this and other security measures.

Now, here’s how to change passwords via CMD using net user:

  1. Open an administrator Command Prompt window. To do this, type cmd into the Start menu, then right-click on the Command Prompt entry and choose Run as administrator.
    1. You can also use PowerShell or the Windows Terminal to perform this; you’ll find a shortcut to those by right-clicking the Start button or hitting Win + X.
  2. Type the following net user command and press Enter to list all the users on your system. When they appear, take note of the account name you want to change the password for:
     net user 
  3. To change a password, type the net user command shown below, replacing USERNAME and NEWPASS with the actual username and new password for the account. If the username is more than one word, you’ll need to place it inside quotes, as shown:
     net user USERNAME NEWPASS 
     net user "USER NAME" NEWPASS 
  4. After you press Enter to run this command, you’ll see a message that it completed successfully. Now you can use the new password to log into this account, just like if you had changed it via the graphical interface.
Windows 10 Change Password Net User

If you see an Access denied message when you try this, make sure that you started the Command Prompt (or other command line window) as an Administrator. Standard users can’t change the password for other accounts. If you see an error that the username wasn’t found, make sure you typed it correctly.

How to Privately Change a Password With Net User

You might want to prevent people around you from seeing the new password that you type when using net user. Thus, for more privacy, you can use a slightly different command to prevent the new password from appearing in plain text onscreen.

To do this, follow the above instructions, but during step 3, enter an asterisk instead of the password. Be sure to still replace USERNAME with the actual username:

 net user USERNAME *  

Windows will then ask you to type a new password twice. However, with this method, the passwords don’t appear as you type—making sure anybody nearby won’t see them.

Change Your Windows Password More Conveniently

Now you know how to use the net user command to change passwords in Windows. It’s a quick way to change passwords without sorting through menus, plus you can change multiple passwords in quick succession without your hands leaving the keyboard.

Give it a try next time you need to change a user password. And when you set a new one, make sure to choose a strong password that’s not easy to guess or crack.

  • Command line install driver windows
  • Com ports in use windows
  • Codesys sp for windows nt realtime
  • Command shutdown windows command line
  • Com port monitor windows 10