How to Use Command Line Change Password on Windows OS

In this guide, you can learn how to use command line change password on Windows system, and how to reset user password via CMD even without login.

Posted by @Lucas December 17, 2024 Updated By @Lucas June 8, 2023

Why choose command line to change password?

Establishing a stringent password policy is vital for organizations, emphasizing the need for users to regularly change their passwords. When enforcing a policy that prompts users to reset their passwords every few weeks, the system will automatically request a new password upon login once the designated time has elapsed.

Although changing your password through the Settings app is possible, opting for the command line offers a faster and more efficient alternative. Even if you're unfamiliar with text commands on Windows, using the net user command to change your password is relatively straightforward.

Additionally, for local account users experiencing difficulties accessing the system or encountering password-related issues, using the command line proves to be an invaluable shortcut for resolution. The following section will provide detailed instructions on changing your Windows password using the command line.

Effortlessly using command line change password

This section will walk you through the process of changing Windows password from command line, and also provide a method for resetting user password via CMD if you've forgotten your password and are unable to enter the system. But, please keep in mind that this approach only works for local accounts in Windows and does not work for Microsoft account logins. Password changes for Microsoft accounts must be performed using Microsoft's online account management page.

1. Change password via command line after login

To change the password of another Windows user using the command line, you'll need administrative privileges. If you're unable to make any changes due to a forgotten administrator password, you can follow these steps to regain access:

Step 1. Launch an administrator Command Prompt window by typing "cmd" into the Start menu, then right-clicking the Command Prompt entry and selecting "Run as administrator."

Step 2. Alternatively, you can use PowerShell or the Windows Terminal by right-clicking the Start button or pressing Win + X.

Step 3. Type the command "net user" and press Enter to display a list of all users on your system. Take note of the account name for which you wish to change the password.

Step 4. To change the password, use the following "net user" command, replacing USERNAME and NEWPASS with the actual username and new password for the account. If the username consists of multiple words, enclose it in quotes. Example: "net user username new password."

Tip: To ensure password privacy, modify the command as follows: "net user USERNAME *." Windows will prompt you to enter a new password twice, with the passwords hidden as you type.

Step 5. After executing this command, you'll receive a message confirming its successful completion. You can now log into the account using the new password, just as if you had changed it via the graphical interface.

โ˜… Note:
 If you encounter an "Access denied" message, ensure that you've started the Command Prompt or other command line window as an Administrator. Standard users do not have permission to use command line change password for other accounts. If you receive an error stating that the username was not found, verify that you entered it correctly.

2. Change Windows password from command line without login

When you're unable to access the system, you can access CMD through the Troubleshoot option during boot or by using a Windows installation media.

Step 1. In the Windows login interface, press "Shift" and click "Restart" simultaneously. This will initiate the Windows recovery mode. Select "Troubleshoot."

Step 2. Within the Advanced options window, choose "Advanced options" and then "Command Prompt."

Step 3. In the CMD interface, enter "diskpart" and press "Enter."

Step 4. Type "list volume" and press "Enter" to view all volumes. Remember the drive letter assigned to the system drive. Exit the Diskpart utility by entering "exit" and pressing "Enter."

Step 5. In the CMD interface, enter "move E:\windows\system32\utilman.exe E:" to move the utilman.exe file to the root directory of the system drive.

Step 6. Next, input "copy E:\windows\system32\cmd.exe E:\windows\system32\utilman.exe" and press "Enter" to copy the cmd.exe file to the designated path.

Step 7. Enter "wpeutil reboot" and press "Enter."

Step 8. Click on the user icon to open the CMD window. Type the command "net user password" and press "Enter." Finally, exit this tool by typing "exit" and pressing "Enter," allowing you to log in with the new password.

A more user-friendly approach to using command line change password

If you prefer a simpler method to reset your password, consider utilizing AOMEI Partition Assistant Professional—a powerful third-party password resetting tool. This software facilitates the creation of a PC password reset USB, enabling you to effortlessly reset or remove forgotten passwords through a user-friendly graphical interface.

In contrast to Windows password reset disks, this tool does not require the creation of a password reset disk in advance. Furthermore, AOMEI Partition Assistant Professional offers a range of additional features, including Data Recovery, Disk Clone Wizard, and Allocate Free Space, providing a comprehensive solution for various system management tasks.

Free DownloadWin 11/10/8.1/8/7/XP
Secure Download

Step 1. Insert a USB into the PC, download and open this useful tool, then click "Tools" and "Reset Windows Password".

Step 2. A window will pop out to ask you to create the bootable USB, click "Next".

Step 3. Choose the "General USB Flash Disk" option, and click "Proceed". The target USB will be formatted, so all data on the USB may be deleted, so please back up them first.

Step 4. Read the popped notice carefully and click "Yes".

Step 5. Wait patient, the tool is creating the password reset USB, click "Finish" when the operation is finished.

Step 6. Turn off the PC and restart it. You'll be asked to change the boot drive, boot the PC from the created USB, then choose the Windows system and click "Next".

Step 7. You can see all accounts on the PC, click the target account, then tick "Remove Account Password" or "Reset Account Password", click "Next".

Step 8. If you select "Reset Account Password", you can set the new password and then click "Yes". If you select "Remove Account Password", you can follow the next guide to remove it.

Ending

Using command line change password is a quick method when you want to reset password. However, if you’re not familiar with command lines, we suggest you choose AOMEI Partition Assistant to perform an easier and safer choice for this task.