Windows 10 – Changing a user's password
Forgot your Windows password? What now?
There is a way to change your password so you can get access again.
First, unless you already have a USB stick or CD with a Live Distro, you need a computer to download one.
I usually use Xubuntu, Ubuntu or any other derivative of the latter.
After downloading the ISO file, we create a USB stick or CD to boot the PC from. On Linux you can use the dd command; on Windows, a tool such as Rufus.
We boot into the Live Linux and mount the Windows partition where the system is installed.
We go to the folder “C:\Windows\System32”
cd <mount point>/Windows/System32find the file cmd.exe and rename it to cmd.exe.tmp
mv cmd.exe cmd.exe.tmpfind the file sethc.exe and rename it to cmd.exe
mv sethc.exe cmd.exethen rename the file cmd.exe.tmp to sethc.exe
mv cmd.exe.tmp sethc.exeWe restart the computer, removing the USB stick or CD used to boot the Live Linux, and when we reach the login screen we press the SHIFT key 5 or 6 times, and a command prompt window appears.
In that window we run the following commands:
To see which user names exist, in particular the one(s) whose password we want to change
net userChange the password
net user <username> <newpassword>Afterwards, rename the files back to their original names, reversing the process described above (cmd.exe and sethc.exe).