How To Reset A Windows 10 Password Via Command Prompt

Have you ever gotten locked out of your Windows 10 computer or had to figure out how to change a user password like the administrator password? Windows 10 offers several approaches to reset Windows user passwords if you know the current password or not. One of the easiest methods is to reset a Windows 10 password via the command prompt.

In this article, you will learn many different ways to reset Windows 10 passwords using the command-line and you’ll even see how to get back into a locked out Windows computer.


This tutorial is going to get hands-on and go over the steps to reset a Windows 10 password. Other than a Windows 10 computer, you will also need the Windows 10 recovery media if you can’t log in to the PC.

This tutorial will use Windows 10 Build 1909 for all examples and will be working on a computer that is not in an Active Directory domain.

Resetting a Windows 10 Password While Logged In

If you need to reset a password, chances are you’ll be in one of two states; logged-in and locked out. Let’s first cover how you can reset a password while logged into Windows with an administrative user account.

Verifying Reset Privileges

To reset a password while logged into Windows 10, you must have permission to do so. Although you could apply granular permission to reset a password, this tutorial will take the easy route and require a user to be in the Administrators group.

To confirm the account you’re logged in with is a member of the Administrators group:

  1. Click on the Start menu and type cmd, to open the command prompt window.

Be sure to right-click on cmd and run the command prompt as administrator so you have the rights to make changes.

  1. With the Command Prompt window open, type whoami to get the logged on user. The string before the \ is the name of the computer.


. Now type net user followed by your logged-in user account.

net user adambertram

The net user command is a handy command in nearly all Windows versions that will pull information about local user accounts, disable and enable user accounts and reset passwords.

You’ll see a lot of output but the information you’re looking for is at the bottom as shown below. You can see that the adambertram local account is part of the Administrators group.

Resetting a User Password via CMD

Once you’ve confirmed your logged-in account has permission to reset the password, you can now reset the password. To do that:

With the Command Prompt still open, type net user followed by the user account and the new password. The command below is changing the local adambertram user account’s password to P@ssw0rd1.

net user adambertram P@ssw0rd1

Once complete, you can now login with the adambertram account with the new password!

Resetting a User Password via PowerShell

The more “modern” way to reset a Windows 10 user password is to use PowerShell. PowerShell is a shell that’s available in all Windows operating system starting in Windows 7.

To reset a user password via PowerShell:

  1. Click on the Start menu, type in ‘powershell’ and open Windows PowerShell as administrator.

With PowerShell open, you’ll now need to define the new password but also convert it to a secure string. A secure string is one way PowerShell ensures passwords aren’t stored in plain text. This step is enclosed in parentheses below.

The Set-LocalUser cmdlet is the command that actually changes the password.

Set-LocaUser -Name adambertram -Password (ConvertTo-SecureString "P@ssw0rd" -AsPlainText -Force)

Resetting a Locked Out Windows 10 Password (Safe Mode)

Changing a password, as you’ve seen above, is a breeze if you can’t actually log into the computer. But what if you’re completely locked out and can’t log in at all? In that case, you’re not completely out of luck but you’ve got some extra work to do!

To reset a user password while not logged in, you’ve got two options; using Windows 10 safe mode and recovery media. Let’s cover each one now starting with safe mode.

Safe Mode is a Windows 10 troubleshooting tool that restarts the PC in a basic state using a limited set of files and drivers.

You can use safe mode to access the command prompt without loading the full operating system bypassing the login screen.

Getting into Safe Mode

First up, you need to get into safe mode. To do that:

  1. Log out of Windows 10.

From the main login screen, press and hold the Shift key while clicking Restart as shown below. Once restarted, Windows 10 will be at a spot to tell it you need to boot into safe mode.


  1. From the Advanced Boot Options screen, click on Troubleshoot. The Troubleshoot screen is a place in safe mode where you can fix some bootup and other Windows 10 problems.

  2. While on the Troubleshoot screen, select Advanced Options.


  1. The Advanced Options screen displays several options to choose from. Click on Startup Settings .

  1. On the Startup Settings screen, select the Restart button. Once restarted, Windows 10 will be in safe mode.

  1. After restarting, the Startup Settings screen will list several options to choose from. Press 4 to restart into safe mode.

  1. After restarting again, you should now see a Command Prompt opens with elevated privileges (Administrator: ) rather than the normal Windows 10 desktop.

  1. Once you have the Command Prompt open in safe mode, the only thing left to do is use net user to reset the password for the user account.
net user adambertram P@ssw0rd1

Resetting a Locked Out Windows 10 Password (Recovery Media)

If you cannot reboot into safe mode, you can also use the recovery media to change user account passwords. Doing so requires you to copy cmd.exe to the local drive and change the password using the same methods as above.

Let’s step through how to make it happen.

To use this method, you must have already created recovery media probably on a USB stick or a Windows 10 installation disk.

  1. Insert the recovery media and restart the computer. Once Windows reboots, the Windows setup screen will appear.

  1. Press Shift + F10 to open a Command Prompt.

  1. In the Command Prompt window run the following two lines. These lines essentially overwrite a file called utilman.exe (Utility Manager) on the Windows 10 sign-in screen located in C:\Windows\system32 with cmd.exe.
move c:\windows\system32\utilman.exe c:\
 copy x:\windows\system32\cmd.exe c:\windows\system32\utilman.exe
  1. Now, remove the installation disk or the recovery media and restart the computer again.

  2. Once the Windows 10 login screen comes up on the Windows 10 sign-in screen tap the Utility Manager icon found on the bottom-right corner to open the command prompt as shown below.

  1. Now that you’re in a command prompt again, simply change the password with net user as before.
net user adambertram P@ssw0rd1
  1. Now restart Windows 10 and login with the user account with the new password!

Source: adamtheautomator

Happy learning!