Reset Windows 7 admin password with Command Prompt

This method is for you when you forgot Windows 7 admin password and are unable to log on. Sometimes, it is used as a hacking method, which is not recommended. Computer novices should use this method with caution because a mistake might make you cannot use Windows 7 properly.

To reset Windows 7 admin password using Command Prompt when you are already locked out, you have to boot your computer from a Windows 7 installation/setup disc.

Follow the steps :

Step 1:

Boot the computer from a Windows 7 installation/setup disc.

Insert the Windows 7 installation/setup disc into the computer on which you need to reset Windows 7 admin password, and start/restart the computer from the disc (USB or CD).

Step 2:

Bring up the Command Prompt window.

  • After the computer boots from the Windows 7 setup disc successfully, you will see the Install Windows screen, as shown below. Select your language and the keyboard input method, and then click Next.
Windows 7 install window
  • Click Repair your computer.
Windows 7 Repair your computer option
  • Your Windows 7 will be listed on the System Recovery Options dialog. Check the letter (typically the C) of the disk where your Windows 7 is installed, and click Next to continue.
Windows 7 select recovery option
  • Now click Command Prompt. Then a Command Prompt will open.
Windows 7 select cmd

Note: At this point, you can’t reset Windows 7 admin password with the Command Prompt, instead, you have to do the next step.

Step 3:

Overwrite the sethc.exe with cmd.exe.

  • In the open Command Prompt window, type copy c:\windows\system32\sethc.exe c:\ and hit Enter. This command will back up the original sticky keys file in Windows 7.
Windows 7 command to copy sethc.exe
  • Type in copy c:\windows\system32\cmd.exe c:\windows\system32\sethc.exe, and hit Enter. When asked whether to overwrite c:\windows\system32\sethc.exe, type Yes and press Enter key. This will overwrite the sethc.exe with the cmd.exe.
Windows 7 command for replace smd.exe with sethc.exe

Step 4:

Reset Windows 7 admin password with Command Prompt.

  • When you come to the Windows 7 login screen, press the Shift key five times to bring up a sethc.exe window. It can be used in place of the Command Prompt.
Windows 7 cmd screen of sethc
  • Type net user and hit Enter. Replace the and with your administrator account’s name and your new password. When ‘The command completed successfully’ text is displayed, your Windows 7 admin password is reset successfully.
Windows 7 command for change admin pwd

Close the sethc.exe window, and log on to Windows 7 with the new administrator password.