Reset Windows 11 Admin Password Using CMD
In this article
Yes, you can reset a forgotten Windows 11 admin password using Command Prompt (CMD), but only if you have another admin account or a password reset disk. If you're locked out entirely, you'll need to use the built-in recovery environment or a Windows installation USB to access CMD. This guide walks through the safest method that works on most Windows 11 systems.
What You'll Need
- Another Windows 11 admin account (even if it's a local account) with a known password.
- If you don't have another admin account, you'll need a Windows 11 installation USB drive (or a recovery drive) to boot from.
- A computer that is not a Microsoft account–only setup – this method works for local accounts, not for Microsoft accounts tied to online credentials.
Step-by-Step
Method 1: Using Another Admin Account (Easiest)
- Log in to Windows 11 using an account that has administrator privileges.
- Press Windows + X and select Terminal (Admin) or Command Prompt (Admin). If prompted by User Account Control, click Yes.
- In the command prompt window, type the following command and press Enter:
net user
This lists all user accounts on the PC. Note the exact username of the account whose password you want to reset. - Type the following command, replacing
usernamewith the actual username andnewpasswordwith your chosen new password:net user username newpassword
For example:net user John P@ssw0rd - Press Enter. You should see the message The command completed successfully.
- Close the command prompt and restart your PC. Log in with the new password.
Method 2: Using Windows Recovery Environment (When Locked Out)
- Boot your PC from a Windows 11 installation USB drive (or a recovery drive). If you don't have one, you can create it on another PC using Microsoft's Media Creation Tool.
- When the Windows Setup screen appears, press Shift + F10 to open Command Prompt.
- At the command prompt, type
diskpartand press Enter. - Type
list volumeand press Enter. Note the drive letter of your Windows installation (usually C: or D:). - Type
exitto leave diskpart. - Type the following command to move the backup of the Utility Manager (utilman.exe) and replace it with Command Prompt (cmd.exe). This is a well-known trick that lets you open CMD from the login screen.
move C:\Windows\System32\utilman.exe C:\Windows\System32\utilman.exe.bak
ReplaceC:with your actual Windows drive letter if different. - Now copy cmd.exe to utilman.exe:
copy C:\Windows\System32\cmd.exe C:\Windows\System32\utilman.exe - Close the command prompt and remove the USB drive. Restart the PC normally.
- On the login screen, click the Ease of Access icon (the little person with a circle) – this will open Command Prompt instead of the usual accessibility settings.
- In the command prompt, type
net userto see usernames, then use the samenet user username newpasswordcommand to reset the password. - Restart the PC and log in with the new password.
- Important: After resetting, restore the original utilman.exe by booting back to the USB, opening CMD, and typing:
move C:\Windows\System32\utilman.exe.bak C:\Windows\System32\utilman.exe
Common Mistakes
- Typing the wrong username: The
net usercommand lists exact usernames. Copy them exactly, including spaces or numbers. - Using a Microsoft account: If your account is tied to a Microsoft account (email), this CMD method will not work because the password is verified online. You must reset via Microsoft's website or use the “I forgot my password” link on the login screen.
- Forgetting to restore utilman.exe: If you use the recovery method and don't restore the original file, anyone can access your system's command prompt from the login screen – a serious security risk.
- Running CMD without admin rights: The
net usercommand requires elevated privileges. If you're not in an admin account, you'll get an “Access denied” error.
Tips
- Always create a password reset disk for local accounts before you forget your password. Go to Control Panel > User Accounts > Create a password reset disk.
- Use a strong password that is easy to remember but hard to guess – combine letters, numbers, and symbols.
- If you have a Microsoft account, set up security questions or use the Microsoft account recovery page – it's safer and doesn't require CMD.
- Keep your Windows installation USB in a safe place – it's a powerful tool for recovery, but also a security risk if it falls into the wrong hands.
Troubleshooting
- “Access denied” when using net user: Make sure you're running Command Prompt as Administrator. If you're using the recovery method, ensure you're in the correct Windows drive (check with
dir C:\Windows). - “The user name could not be found”: Double-check the username spelling. Use
net userto list all accounts, and note that usernames are case-insensitive but must match exactly. - CMD opens but net user doesn't work: In the recovery environment, you might be in the Windows PE environment, not the actual Windows installation. Make sure you've navigated to the correct drive (e.g.,
C:) and that the Windows folder is there. - After the utilman trick, the Ease of Access icon does nothing: This usually means the copy command failed. Reboot to the USB, redo the copy, and ensure you're copying from the correct drive.
- If you get a BitLocker prompt: If your drive is BitLocker-encrypted, you'll need the recovery key to access the system from the USB. You can get it from your Microsoft account or from the recovery key backup.
Frequently Asked Questions
Can I reset a Microsoft account password with CMD?
No. Microsoft account passwords are verified online. You must use the official Microsoft account recovery page or the “I forgot my password” option on the login screen.
Will this method work on Windows 11 Home?
Yes, the net user command works on all editions of Windows 11, including Home. The recovery environment method also works, but the steps are the same.
Is it legal to reset a password this way?
Yes, as long as you own the computer or have explicit permission from the owner. Using this method to gain unauthorized access is illegal.
What if I don't have another admin account or a USB drive?
You'll need to create a recovery drive on another computer, or use a third-party password reset tool (which often requires a paid license). The safest free option is to use the Windows installation media.
Does this method work if the account is a local account but has a PIN?
Yes, the PIN is separate from the password. Resetting the password with net user will not change the PIN, but you can still log in with the new password. You can then change or remove the PIN in Settings.
After resetting, will I lose any files?
No, resetting the password does not delete any files. However, if you use the recovery method and accidentally run format or other destructive commands, you could lose data. Stick to the steps above.