NOTE:-This method only works for a local account and will not work for domain accounts
You can reset the local admin password on a Windows 7 or Windows 8 computer using the net.exe tool as follows:-
1. Click the Start button and type cmd followed by holding Ctrl+Shift and press Enter.
2. Click the Yes button on the User Account Control window and a command prompt window will appear.
3. Type the following command to generate a random password for the user account Raymond. Simply replace the word Raymond in the command line below with the username that you want to set a random password.
net user administrator /random
The new random password is generated on screen with the status message saying “The command completed successfully“. There is no need to supply the current password for the user account. If you get the error message “System error 5 has occurred. Access is denied“, it means that your account doesn’t belong to administrator group or you did not launch the command prompt as administrator. Pay special attention to step 1 where we suggest you to hold Ctrl+Shift keys and followed by pressing Enter on your keyboard.
Important note, be very careful with random password because normally it takes a lot of effort and time to memorize it. You can write it on a piece of paper and keep it safe or use a secure password manager tool.