Windows change password from command line

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?

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

To change a Windows password using the Command Prompt, you can use the `net user` command followed by the username and the new password.

net user <username> <newpassword>

Replace `<username>` with the actual username and `<newpassword>` with the desired new password.

Understanding the Basics of CMD

What is CMD?

The Windows Command Prompt, or CMD, is a command-line interface that allows users to interact with the operating system by executing text-based commands. Unlike a graphical user interface (GUI), CMD provides a more direct way to manipulate system settings, execute scripts, and perform tasks, making it a powerful tool for both casual users and system administrators.

Why Use CMD to Change a Password?

Using CMD to change a password offers several advantages:

  • Speed and Efficiency: CMD commands can often accomplish tasks more quickly than navigating through the GUI.
  • Automation: Scripts can be written to automate repetitive tasks, including password changes.
  • Remote Management: In environments where remote management is necessary, CMD allows administrators to manage user accounts without physical access to machines.

Change Admin Password with Cmd: A Quick Guide

Change Admin Password with Cmd: A Quick Guide

How to Access CMD

Opening Command Prompt in Windows

There are several ways to open the Command Prompt in Windows:

  1. From the Start menu: Click on the Start button, type «cmd,» and hit Enter.
  2. Using the Run dialogue: Press `Windows + R`, type «cmd,» and press Enter.

Running CMD as an Administrator

For many commands related to user management, it’s essential to run CMD as an administrator. This helps ensure you have the necessary privileges to change passwords. To do this:

  • Right-click the CMD icon, then choose «Run as administrator.»

Changing Password Using Cmd: A Simple Guide

Changing Password Using Cmd: A Simple Guide

Syntax Overview

To change a user’s password using CMD, you’ll use the `net user` command. The general syntax is as follows:

net user username newpassword

In this command:

  • username is the account whose password you want to change.
  • newpassword is the desired new password for that account.

Step-by-Step Instructions

Changing Your Own Password

If you want to change your own password through CMD, you can use a simple command:

net user %username% newpassword
  • Here, `%username%` automatically refers to the currently logged-in user, which simplifies the process.

Changing Another User’s Password

If you’re an administrator and want to change someone else’s password, the command will look like this:

net user otherusername newpassword
  • Replace `otherusername` with the actual username of the account you wish to modify. Remember: Changing another person’s password can lead to access issues, so always inform the user.

Special Cases

Using CMD to Reset a Forgotten Password

In instances where a user cannot log in due to a forgotten password, CMD can also be used—often through software that boots into recovery mode. One common method is:

  1. Boot the machine from a recovery disk.
  2. Access CMD from the recovery options.
  3. Execute the following command to reset the password:
net user username newpassword
  • This method may require changes to user account settings but is effective for regaining access.

Error Handling

Common Errors and Solutions

While changing a password using CMD is straightforward, users may encounter common issues:

  • User not found: Double-check the username for typos; it’s case-sensitive.
  • Access Denied: Ensure you’re running CMD with administrative privileges.
  • The password must be at least…: You may need to follow password complexity requirements.

Change Password Through Cmd: A Simple Step-by-Step Guide

Change Password Through Cmd: A Simple Step-by-Step Guide

CMD Alternatives for Password Changes

Using PowerShell

For users comfortable with scripting, Windows PowerShell provides a rich alternative to CMD. The command to change a password in PowerShell is as follows:

Set-LocalUser -Name "username" -Password (ConvertTo-SecureString "newpassword" -AsPlainText -Force)
  • This command accomplishes the same goal as the CMD `net user` command but allows greater flexibility and scripting options.

Start Windows from Cmd: A Simple Step-by-Step Guide

Start Windows from Cmd: A Simple Step-by-Step Guide

Security Considerations

Importance of Strong Passwords

Changing a password offers a perfect opportunity to enhance security. Follow best practices to create strong passwords:

  • Length: Use a minimum of 12 characters.
  • Complexity: Include upper and lower case letters, numbers, and symbols.
  • Unique: Ensure that each password is unique to avoid cross-site vulnerabilities.

Protecting Your CMD Usage

Using CMD cannot only change passwords but also manage various system settings, making it vital to protect against unauthorized usage. Here are some tips:

  • Run CMD only when necessary: Limit the exposure of CMD to reduce the risk of accidental changes.
  • Log out when done: If accessing someone else’s machine, log out of CMD and shut down the computer properly to prevent unauthorized use.

Windows Reboot From Cmd: A Quick How-To Guide

Windows Reboot From Cmd: A Quick How-To Guide

Conclusion

Understanding how to change Windows password from CMD opens up several options for managing user accounts efficiently. Whether you’re an administrator overseeing multiple accounts or a user managing your own credentials, CMD provides a straightforward and powerful approach. Practice these commands and become more comfortable navigating the command line for all your system management needs.

Change Password in Cmd for Windows 7: A Simple Guide

Change Password in Cmd for Windows 7: A Simple Guide

Additional Resources

  • For further reading, refer to the [official Microsoft documentation on CMD commands](https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/windows-commands).
  • Explore additional tools and resources for learning CMD, including online tutorials and command reference guides.

Open Windows Settings from Cmd: Your Quick Guide

Open Windows Settings from Cmd: Your Quick Guide

FAQs

  • Can I change a password without being an administrator?
    No, changing other users’ passwords requires administrative privileges.

  • What if I forget the new password I just set?
    You might need to reset the password again using a recovery method.

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.

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

0 комментариев
Старые
Новые Популярные
Межтекстовые Отзывы
Посмотреть все комментарии
  • Проводник жрет много памяти windows 10
  • Где хранятся автономные файлы windows
  • C windows system32 fondue exe
  • Проводник windows некорректно работает
  • Port mapping windows server