Smart Systems for Home

Plain how-to guides for smart home, security and home Wi-Fi

Reset Windows 7 Password Using CMD: Step-by-Step

· 6 min read · Home Tech

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions

You can reset a forgotten Windows 7 password using Command Prompt (CMD) by replacing the sticky keys utility (sethc.exe) with a command prompt shortcut. This works because Windows 7 runs sethc.exe with system privileges when you press Shift five times at the login screen. By swapping it for cmd.exe, you get a command prompt with admin rights, allowing you to change any user's password. You'll need physical access to the PC and a Windows 7 installation or repair disc (or a system repair disc).

What You'll Need

  • A Windows 7 installation DVD or a system repair disc (bootable).
  • Physical access to the computer (keyboard and mouse).
  • An account with administrator privileges on the PC (or the ability to boot from the disc).

Step-by-Step

  1. Boot from the Windows 7 installation disc. Insert the disc, restart the PC, and press any key when prompted to boot from CD/DVD. If your PC doesn't boot from the disc automatically, enter the BIOS/UEFI setup (usually by pressing F2, F12, Del, or Esc during startup) and change the boot order to prioritize the optical drive.
  2. Open the System Recovery Options. When the Windows 7 setup screen appears, select your language and click Next. Then click Repair your computer at the bottom-left corner.
  3. Select the operating system. In the System Recovery Options window, choose the Windows 7 installation you want to repair (usually the only one listed) and click Next.
  4. Open Command Prompt. From the list of recovery tools, select Command Prompt. A black command window will open.
  5. Back up the original sethc.exe file. Type the following command and press Enter: copy c:\windows\system32\sethc.exe c:\windows\system32\sethc.exe.bak – this creates a backup so you can restore it later.
  6. Replace sethc.exe with cmd.exe. Type this command and press Enter: copy c:\windows\system32\cmd.exe c:\windows\system32\sethc.exe – when prompted to overwrite, type Y and press Enter.
  7. Close the Command Prompt and restart. Type exit and press Enter, then click Restart in the System Recovery Options window. Remove the installation disc when the PC restarts.
  8. Trigger the Sticky Keys shortcut. At the Windows 7 login screen, press the Shift key five times in a row. A Command Prompt window should open with administrator privileges.
  9. Reset the password. Type the following command, replacing username with the actual account name: net user username newpassword – press Enter. You'll see a message that the command completed successfully.
  10. Close the Command Prompt and log in. Type exit and press Enter, then enter your new password at the login screen.
  11. Restore the original sethc.exe (optional but recommended). After logging in, open Command Prompt as administrator (Start > All Programs > Accessories > right-click Command Prompt > Run as administrator). Type: copy c:\windows\system32\sethc.exe.bak c:\windows\system32\sethc.exe and press Enter. This restores the sticky keys functionality.

Common Mistakes

  • Typing the wrong username. If you don't know the exact account name, at the login screen you can see the username on the bottom-left corner. Or, when you're at the sethc command prompt, type net user to list all accounts.
  • Not backing up sethc.exe. If you skip the backup step, you won't be able to restore the original file. This leaves sticky keys broken, though the system will still work.
  • Using a 64-bit vs 32-bit mismatch. The copy command works only if the installation disc matches the architecture of your Windows 7 (32-bit vs 64-bit). If you use a 32-bit disc on a 64-bit system, the file paths might not work. Use the correct disc version.
  • Forgetting to press Shift five times. The trick only works if you press Shift five times quickly at the login screen. If you press it too slowly or not enough times, nothing happens.

Tips

  • Use a strong new password that you'll remember. Write it down somewhere safe.
  • If you have a system repair disc created on the same PC, it works just like the installation disc for this method.
  • After resetting the password, consider creating a password reset disk for future emergencies (Control Panel > User Accounts > Create a password reset disk).
  • If you're worried about security, you can disable sticky keys entirely after restoring sethc.exe, but that's not necessary.

Troubleshooting

If the Command Prompt doesn't open when you press Shift five times: Make sure you're at the login screen (where you type your password). Press Shift five times quickly, not holding it. If it still doesn't work, you may have replaced the wrong file. Double-check that you copied cmd.exe over sethc.exe, not the other way around.

If you get an "Access is denied" error when copying: This usually means you're not in the System Recovery Command Prompt. Make sure you followed the steps to boot from the disc and select Command Prompt from the recovery options. That prompt runs as SYSTEM, which has full permissions.

If the copy command says "The system cannot find the file specified": The drive letter might not be C:. In the recovery environment, the system drive could be D: or another letter. Type dir c:\windows to check if C: has the Windows folder. If not, try dir d:\windows and use the correct drive letter in all commands.

If the net user command fails: Ensure you typed the username exactly as it appears (case doesn't matter for the username, but spelling does). Use net user to see the list of accounts. Also, make sure the password doesn't contain spaces or special characters that might need quotes – if it does, enclose it in quotes, e.g., net user username "new password".

If the PC doesn't boot from the disc: Restart and press the key to enter the boot menu (often F12) or BIOS setup. Change the boot order so the optical drive is first. Save changes and exit.

Frequently Asked Questions

Will this method work on Windows 10 or 11?

No, this specific sethc.exe trick is patched in later versions of Windows. It only works on Windows 7 (and earlier, like XP).

Is this method safe for my files?

Yes, it doesn't touch your personal files. It only changes the password, so all your documents, photos, and programs remain intact.

Can I use this to reset a Microsoft account password?

No, this only works for local Windows accounts. If you use a Microsoft account, you'll need to reset the password online via Microsoft's website.

What if I don't have a Windows 7 installation disc?

You can create a system repair disc from another Windows 7 PC (Control Panel > Backup and Restore > Create a system repair disc). Or you can download the official Windows 7 ISO from Microsoft (if still available) and burn it to a disc or USB.

Will this disable Sticky Keys permanently?

Only if you don't restore the original sethc.exe. Follow step 11 to restore it, and sticky keys will work normally again.

Can I use this to hack someone else's computer?

This method is intended for recovering access to your own computer. Using it on someone else's PC without permission is illegal and unethical. Always have the owner's consent.