The fastest way back in depends on what you remember
If you cannot remember your Windows password, your path forward depends on whether you set up a password reset disk, a recovery email, or a phone number on your account. Windows stores these recovery options in your account settings, and they work even when you cannot log in. If you set up none of these, you will need to use your installation media or a local account workaround. The method that works fastest is the one you prepared before you locked yourself out — but if you prepared nothing, you still have options that do not require erasing your files.
Start by asking yourself: Do I have access to the email address or phone number I used when I created this account? Do I have a USB drive or disk I created specifically to reset my password? If you answer yes to either question, you can reset your password in under ten minutes without touching the locked computer. If you answer no to both, you will need to restart the computer itself and work from there.
Key Takeaways
- A recovery email or phone number linked to your Microsoft account lets you reset your password from another device without touching the locked computer.
- A password reset disk, created before you forgot the password, can reset it from the login screen itself in under five minutes.
- If you have no recovery method set up, you can restart into Safe Mode with Command Prompt and create a new local administrator account without erasing your files.
- Windows installation media can reset your password, but the process takes longer and requires a USB drive or DVD and another working computer.
- If your computer is password-protected at startup by your employer or school, these methods may not work — contact your IT department instead.
Using a recovery email or phone number
This is the fastest method if you set up a Microsoft account with a recovery email address or phone number. Go to account.microsoft.com from any device with internet access — a phone, tablet, or another computer. Click Sign in, then Can't access your account? at the bottom of the login box.
Enter the email address or phone number associated with your Windows account. Microsoft will send a code to that recovery email or phone number. Enter the code on the next screen, then create a new password. Once you have set the new password, return to your locked computer and log in with it. This method works whether your account is a Microsoft account or a local account, as long as you linked recovery information to it before you forgot the password.
This approach leaves all your files, programs, and settings untouched. You are straightforward changing the password that unlocks them. If you have multiple email addresses or phone numbers on file, Microsoft will let you choose which one receives the reset code.
Using a password reset disk
If you created a password reset disk before you forgot your password, you can use it at the Windows login screen. Insert the USB drive or floppy disk into your computer and restart it. At the login screen, click Reset password below the password field. Windows will walk you through selecting the disk and creating a new password.
A password reset disk is a small file that you create in advance through Windows settings. If you have one, this is the fastest on-computer method — it takes about five minutes and requires no internet connection. If you do not have one, you cannot create one now that you are locked out. The disk works only on the computer where it was created, so if you have multiple computers, you would need a separate disk for each one.
Creating a new local account from Safe Mode
If you have no recovery email, phone number, or reset disk, you can restart your computer into Safe Mode with Command Prompt and create a new administrator account. This account will have full access to your computer and your files, though you will not be able to access files that were encrypted with your old password.
Restart your computer and hold down the Shift key while it boots. Keep holding Shift until you see the recovery menu. Select Troubleshoot, then Advanced options, then Startup Settings, then Restart. When the computer restarts, press 5 to enter Safe Mode with Command Prompt.
At the command prompt, type net user newusername newpassword /add, replacing "newusername" and "newpassword" with your chosen name and password. Press Enter. Then type net localgroup administrators newusername /add and press Enter. Restart your computer normally and log in with the new account. Your old files will still be there, though some may show as inaccessible until you take ownership of them through file properties.
Using Windows installation media
If Safe Mode does not work or your computer will not boot into it, you can use Windows installation media — a USB drive or DVD with Windows on it — to reset your password. You will need another working computer to create the installation media and a USB drive or blank DVD.
On the working computer, go to microsoft.com/software-read and read the Windows Media Creation Tool. Follow the prompts to create installation media on your USB drive or DVD. Insert the media into your locked computer, restart it, and boot from the media. When the Windows setup screen appears, press Shift + F10 to open Command Prompt. Type diskpart, then list disk to see your drives. Identify your main drive, then use select disk and clean commands to prepare it — but do not do this unless you are certain you have the right disk, because this erases everything on it.
This method is complex and carries a real risk of data loss if you select the wrong drive. Use it only if the Safe Mode method fails and you have no other recovery option. Many people find this step confusing, so if you are not comfortable working with command-line tools, the Safe Mode method is safer and usually works just as well.
What to do if your computer is managed by an employer or school
If your computer is owned by your workplace or school, it may be locked down with policies that prevent you from resetting the password yourself. You will see this if you try Safe Mode and get an error message about group policy, or if your login screen shows your organization's name.
Contact your IT department or help desk. They have tools to reset your password remotely or unlock your account. Do not attempt the methods above on a managed computer — they may trigger security alerts or violate your organization's policies. Your IT department can usually reset your password within a few hours and will verify your identity before doing so.
Preventing this from happening again
Once you regain access, set up recovery options so you never face this again. Open Settings, go to Accounts, then Security options or Recovery options depending on your Windows version. Add a recovery email address and phone number to your Microsoft account. If you use a local account, convert it to a Microsoft account through the same settings menu, then add recovery information.
You can also create a password reset disk now. Go to Settings > Accounts > Sign-in options, scroll down, and click Password reset disk. Follow the prompts to create it on a USB drive. Store the drive somewhere safe — you will only need it if you forget your password again. Many people keep it in a drawer at home or in a safe deposit box.
Frequently Asked Questions
Will resetting my password erase my files?
No. Resetting your password through a recovery email, phone number, or reset disk changes only the password — your files, programs, and settings remain exactly as they were. Creating a new local account through Safe Mode also leaves your files in place, though some encrypted files may become inaccessible. Only the installation media method risks data loss, and only if you select the wrong drive.
Can I reset my password if I do not have internet access?
Yes. A password reset disk works entirely offline and requires no internet. The Safe Mode method also works without internet. Recovery email and phone methods require internet on another device, but not on the locked computer itself.
What if I see an error message when I try to restart into Safe Mode?
Some computers, especially newer ones with find Boot enabled, may not enter Safe Mode using the Shift key method. Try restarting and pressing F8 or F12 repeatedly as the computer boots — different manufacturers use different keys. If neither works, use the Windows installation media method instead. If you see a message about group policy, your computer is managed by an organization and you need to contact your IT department.
Can I reset my password if I forgot my Microsoft account email too?
If you forgot both your password and the email address on your account, go to account.microsoft.com/security and look for an option to recover your account. Microsoft will ask you security questions or send a code to a recovery email you set up previously. If you have no recovery information at all, your only option is the Safe Mode or installation media method to create a new local account.
How long does it take to reset my password?
A password reset disk takes about five minutes. A recovery email or phone takes as long as it takes you to check your email or texts and return to the login screen — usually under ten minutes. Safe Mode takes fifteen to twenty minutes if you are doing it for the first time. Installation media can take an hour or more, especially if you are unfamiliar with command-line tools.