Forgetting the windows logon password is a sad reminder, but it is a good way to reset the password and continue using it without reinstalling the system.
Preparation for resetting: A windows 7 installation media (both optical and USB flash drives are supported). If you do not have a windows 7 installation media, you do not need to proceed with the following steps.
Insert the installation media for windows 7, start from the installation media, and then select repair computer,
Then select the command prompt,
In the pop-up Command Prompt window, enter the following command and press Enter,
Copy c: \ windows \ system32 \ sethc.exe c :\
Note that c indicates the system drive letter. If you cannot find the file, find the correct drive letter for the system disk. This command backs up a file by running the sticky key. Then, enter the following command and press Enter,
Copy c: \ windows \ system32 \ cmd.exe c: \ windows \ system32 \ sethc.exe
This command replaces the execution file of the command prompt with the execution file of the sticky key. After that, you can see the prompt.
Restart your computer and directly go to the original windows 7 system. If you press Shift five times on the logon page, a command prompt window is displayed,
Enter the command to reset the password, and press Enter,
Net user your username New Password
Here, the user name is the user name you used to log on to windows 7 (that is, the name shown above the Password box), and the new password is used to log on to the system.
Image Source: How-To Geek
After prompting that the command is successful, you can use the new password you just set to log on to the system. Of course, to prevent the logon interface from resetting the password, you also need to restore the previously replaced sticky key. Insert windows 7 installation media, select repair computer, select a command prompt, and enter
Copy c: \ sethc.exe c: \ windows \ system32 \ sethc.exe