Как сменить пароль пользователя windows через командную строку

Last Updated :
24 Apr, 2025

If you are a Windows user, one of the easiest ways to change your password is through the Command Prompt (CMD). This is especially helpful for users who prefer command-line tools or face issues accessing the standard settings menu.

In this article, we’ll guide you through the steps to change your Windows password using CMD, along with a few troubleshooting tips.

Prerequisites:

1. Administrative Rights

2. Familiar with the existing User Accounts

3. Backup the unsaved data

Using «net user» Command to Change the Password

Step 1: Open command prompt as Administrator

Go to the Search Menu, type CMD and select «Run as Administrator».

cmd-as-admin

cmd as admin

Step 2: Enter «net user» to fetch Password

net user <username> <newpassword>
Run-as-ADMIN

Run as ADMIN

Step 3: Run the command to change the password

net user [username] [newpassword]

Replace «[username]» with the username of the account whose password you want to change, and «[newpassword]» with the new password you want to set.

Set-password

Set password

Step 4: Reopen to Confirm

Close the Command Prompt and log in with the new password.

Change-password

Confirm to change the password

How to Privately Change a Password using CMD

Use this method to change the password for any particular user. Here’s how you can do it:

Step 1: Go to Run & open Command Prompt

Go to the Search Menu, type CMD and select «Run as Administrator».

cmd-as-admin

cmd as admin

Step 2: List All Users to Choose

net user
Run-as-ADMIN

Run as ADMIN

Step 3: Change the password for any particular user

net user USERNAME NEWPASS

If your desired user name has more tan one word then follow this pattern:

For Example: Username — ALPHA GTR

net user "ALPHA GTR" NEWPASS 

Now, what if you’re looking to remove a password using Command prompt? Let’s see how you can get it done.

Using PowerShell — Additional Method (1)

Step 1: Go to Start and type PowerShell

Step 2: Type the following command to Change the Password

$username = 'UserNameHere'; $password = Read-Host -AsSecureString; net user $username $password

Note: Replace UserNameHere with the desired user account.

Step 3: Close the PowerShell > Restart > Log in

While in «Safe Mode» — Additional Method (2)

Step 1: Restart your PC and hit F8 several times to enter Windows Boot Mode

Step 2: Safe Mode with Command Prompt > net user

net user <username> <newpassword>

Step 3: Exit and Restart as usual

Steps to Remove a Password Using CMD

If you wish to remove the password for any particular account, you can set the password to blank by removing the password in the command line. Let’s check it out:

Step 1: Go to Run & open Command Prompt

Go to Search Menu > type CMD > select "Run as Administrator"

Step 2: Run this Command to Remove Password

net user USERALPHA ""

Hence, this will clear your previously saved password for the account — USERALPHA

Tips & Tricks

While using CMD to change your password is usually a reliable method, there are a few common issues users may face:

1. Admin Access: Make sure to have admin access.

Without administration access, you won’t be able to perform any of the above-mentioned action.

2. Invalid Username: Do remember the names of user accounts

net user command to list all the exact username.

3. Password Policy Restrictions: Domain restrictions or Specific Password Policies

Make sure the new password meets the system’s password requirements.

Conclusion

Changing password in Windows helps in managing and maintaining privacy. By following the different methods and steps, you can easily reset your password or remove it from your Windows 10 or 11.

Also Read

  • How to Find the Wi-Fi Password Using CMD in Windows 11/10 ?
  • Useful CMD commands for daily use in Windows OS

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

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. Step 1 Click the Windows Start menu icon.

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

  2. Step 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. Step 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.[1]

    • If you’re using Windows XP, you’ll instead type cmd into the Run window.
  4. Step 4 Click Run as administrator.

    It’s near the top of the drop-down menu. Doing so will open Command Prompt with administrator privileges.[2]

    • 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. 1

    Type net user into the Command Prompt and press Enter. Make sure you include the space between the two words.[[3]
    [Image:Change a Computer Password Using Command Prompt Step 5 Version 4.jpg|center]]

  2. Step 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. Step 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.[4]

    • 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. Step 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]

    EXPERT TIP

    Brandon Phipps is a Technology Specialist based in Bakersfield, CA. He is the owner of Second Star Technologies and specializes in Managed IT Services for small and mid-sized businesses in Bakersfield, CA. With over 23 years of experience, he offers expert cloud computing, cybersecurity, and network management solutions. Brandon is a committed community member and coach who leads and innovates in tech and sports coaching. His dedication to local businesses and communities is evident in his hands-on, tailored approach to IT solutions.

    Secure your digital life with online password best practices. Choose a long, easy-to-remember passphrase as your password. You should also avoid using the same password for multiple services or websites.

  5. Step 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.[6]

    • 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.[7]
    • 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?

    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?

    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?

    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

Video

  • 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 2,274,451 times.

Is this article up to date?

Sign in to your MUO account

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.

If you feel that the Login Password for your computer has been compromised, the easiest way to change password on a Windows 11/10 computer is by using Command Prompt.

Apart from this you can also change the password on a Windows computer by going to the Sign-in options Settings screen on your computer.

However, this only applies to Local User Accounts and not to Microsoft User Account, which follows its own process to change the password.

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 Windows 11/10 computer.

Advertisement

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

If you are using a Local User Account, you can find below the steps to change Windows Password using Command Prompt and also by using the Settings App.

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.

1. Type Command Prompt in the Search bar, right-click on Command Prompt in the search results and select Run as Administrator option.

2. On the Command Prompt screen, 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 the 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

1. Open the Command Prompt on your computer with Admin previlages.

2. Type net user Username * > press Enter key > Type New Password and Retype the New Password to confirm.

Advertisement

Change Windows Password Using Net User Command

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

3. 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

If you do not like using the Command Prompt, you can change the Login Password on your Windows 10 or Windows 11 computer by using Settings.

1. 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

Windows 11: Go to Settings > Accounts > Sign-in Options > on the next screen, select Password and click on the Change button.

Change Password Option in Windows 11

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

Confirm Current Password in Windows 10

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

Change Your Password Screen in Windows 10

4. Finally, click on the Finish button.

Finish Change Password Process in Windows 10

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

Понравилась статья? Поделить с друзьями:
0 0 голоса
Рейтинг статьи
Подписаться
Уведомить о
guest

0 комментариев
Старые
Новые Популярные
Межтекстовые Отзывы
Посмотреть все комментарии
  • Dhcp консоль windows 10
  • Windows пробел в пути
  • Aimp skin windows 7
  • Vmware converter windows server 2003
  • Windows 10 usb camera driver windows