What happen when you forgot your password to log into Windows 10 and there is no other account that you could log into?
Turn out Windows 10 has a hidden feature which can be very handy in this situation!
Boot the computer with a Windows 10 Installation CD or Win10PE
Once in the command prompt:
move C:\Windows\System32\utilman.exe C:\Windows\System32\utilman.exe.bat
copy C:\Windows\System32\cmd.exe C:\Windows\System32\utilman.exe
Reboot the computer normally.
When you get to the login screen, normally under bottom right corner, there is this Ease Of Access button . Which is now replaced with CMD.
Open the command prompt:
net user <username> <password> /add
net localgroup administrators <username> /add
That's it. You could now login with that newly created administrator account and reset your forgotten password for that accout!
Reference from here