How to Reset Windows Password Using Command Prompt

To reset the password for a Windows user account, you'll need a Windows installation disk (for versions 7, 8, 8.1, or 10). Follow these steps:

  1. Boot your computer using the Windows installation disk.
  2. Instead of choosing "Install," select the Repair option.
  3. Go to Troubleshoot > Advanced Options > Command Prompt.
  4. Once Command Prompt is launched, it will open in a directory called X:\>.
  5. To change the directory to the drive where Windows is installed, type C: and press Enter.
  6. Type dir to list the contents of the drive. If you do not see the Windows partition, you're in the wrong drive. Try D: or E: until you find the right one.
  7. Once you’re in the correct drive, navigate to the System32 folder by typing cd windows\system32.
  8. Now, rename the osk.exe file to osk.old by typing the following command:
    rename osk.exe osk.old
  9. Next, rename cmd.exe to osk.exe by typing:
    rename cmd.exe osk.exe

By default, when you’re on the login screen, there is an on-screen keyboard (osk.exe). We’ve just replaced it with the command prompt.

Now, restart your system (do not boot from the disk). When you reach the login screen for the user account, follow these steps:

  1. Click on the Ease of Access icon and then select On-Screen Keyboard.
  2. This will open cmd.exe, allowing you to execute commands.
  3. To list all the users on the system, type:
    net user
  4. Once you know the username for the account you want to change, type:
    net user [USERNAME] *
    Replace [USERNAME] with the actual username of the account.
  5. If you want to change the password and enable the built-in Administrator account, run:
    net user administrator /active:yes
  6. After running the above command, you’ll be prompted to set a new password for the account. Enter a new password and close the command prompt.
  7. Log in with the new password you just created.

Once you've logged in, don't forget to undo all the changes:

  1. Boot into the OS disk again and navigate back to the System32 folder.
  2. Rename osk.exe back to cmd.exe:
  3. rename osk.exe cmd.exe
  4. Rename osk.old back to osk.exe:
  5. rename osk.old osk.exe
  6. If you no longer need the built-in Administrator account, deactivate it with:
  7. net user administrator /active:no

That's it! Your password has been reset, and everything is back to normal.