Articles Windows 11 Windows 11 Password Reset with Command Prompt

Windows 11 Password Reset with Command Prompt

Updated: By Lucca Weber

password reset with command prompt

This article shows how to reset Windows 11 password with Command without entering current password. If you forgot your local account password, you can reset password from Command Prompt quickly as long as you still be able to get into Windows 11 system with other sign-in options or another administrator account.

But this only works for local account password, if you want to reset password for your Microsoft account in Windows 11, go to Windows account settings to have a try.

Still be able to get into Windows 11

If you forgot your local account password, please try to sign in Windows 11 with other sign-in options, such as PIN, Picture password. Or Get into Windows 11 with another account which has administrator privilege.

1. Click on search button to open search box, and type in: cmd. Right-click on the search result of Command Prompt, select "Run as administrator".

open command prompt as administrator

2. On Command Prompt window type in: net user username newpassword. (Please change "username" to your user account name, replace "newpassword" with the password you want to reset.)

reset windows 11 password with cmd

If locked out of Windows 11

If you don't have other sign-in options or another user account to get into Windows 11, don't be disappointed, try with this way to open Command Prompt out of Windows 11 and reset forgotten password.

1. Create a bootable USB drive for Windows 11.

2. Set your computer to boot from the USB drive.

Connect the bootable USB drive to your PC device, start or restart Windows 11.

insert usb

When Windows starts again on the flash screen, press UEFI (or BIOS) entering key repeatedly on the keyboard.

press key to get into uefi bios settings

When gets into UEFI (or BIOS) settings, open Boot Menu.

click boot menu

On Boot menu, select your USB drive to boot.

boot from usb drive

3. When boots to Windows 11 installation screen, press "Shift + F10" to open Command Prompt.

press shift and f10

4. On Command Prompt window type in these commands:
c:
cd windows\system32
copy cmd.exe cmd.exe.ori
copy osk.exe osk.exe.ori
del osk.exe
ren cmd.exe osk.exe
(After typing each line of the command, press Enter to execute it. Please remember to replace "c:" with the letter of your system drive.)

change on screen keyboard to cmd

Eject the USB drive from your PC device, and restart your computer with this command: shutdown -r -t 00, and press Enter to run it.

5. When Windows restart to logon screen, click on Accessibility icon, and then click on On-Screen Keyboard. You will be surprised to find the Command Prompt window pops-up instead of On-Screen Keyboard.

click on screen keyboard

6. On Command Prompt window type in this command to reset Windows 11 password: net user username newpassword, and then press Enter to execute it.

7. Close Command Prompt window, type in the new password to log into system.

8. After password reset successfully, set your computer to boot from the bootable USB drive again. When goes to Windows 11 installation screen, open Command Prompt, and change back On-Screen keyboard with these commands:
c:
cd windows\system32
del osk.exe
ren cmd.exe.ori cmd.exe
ren osk.exe.ori osk.exe

This method may be not available for your account in Windows 11. If it doesn't work for you, go and get more methods from this article How to Reset Windows 11 Password without Logging in.

Related Articles