Skip to content
For the complete documentation index, see llms.txt. This page is also available as Markdown.

How to recover the Administrator password in Windows

Migrations

Servers

How to recover the Administrator password in Windows

Keep reading if you want to learn how to recover the Administrator password in Windows, a procedure that is applicable both to recover the administrator user's password in case you don't remember it, or because the administrator is unavailable for any reason.

NOTE: Plenit is not responsible for the misuse of this tutorial, since its purpose is to help administrators do their work. The purpose of this tutorial is to provide possible assistance in migration processes.

This process must be done properly from a physical terminal, or from a virtual terminal with access to the virtual installation media, since two things are needed:

  • Access to physical or virtual power buttons through the hypervisor.

  • Access to physical or virtual drives to load the Windows installation CD/DVD or ISO.

It is important to say that this recovery method is valid for client and server devices. On client it works both on older ones like Windows XP and newer ones like Windows 11. The same goes on the server side; it will work with old versions and even with Windows Server 2025, which is the version on which this tutorial was made.

How to recover the Administrator password in Windows

Pre-requisites or pre-configuration

To successfully complete this tutorial and recover the Administrator password in Windows, you will need:

On one hand, to be registered on the Plenit Platform and have accessed it with your username and password through the login.

On the other hand, to have a subscription to Servers, an on-premises machine whose password you do not know, access to the machine's administration console, access to the installation media, either physically or virtually, to be able to load the CD/DVD or ISO of the Windows version.

Windows Administrator password recovery process

One must insert the operating system image, either in ISO format or CD/DVD format, into the drive to begin the operation.

Once inside, the machine must be booted, staying alert to click <ENTER> when the message of “Press any key to boot from CD or DVD…” appears.

This will cause the boot process to be aborted and the operating system installation process to start .

After a brief loading process, the language selection window will appear, where you should select the language for installation, but in this case it does not matter, and it will be enough to click “Next”.

We click Next from the Windows installation language window

In the next window you must select the keyboard layout of the installation process, although later we are asked again through a wizard, it is recommended to select it to avoid problems. After the selection, you must click “Next”.

We select the keyboard language

In the configuration options menu, you must select “Repair my PC” and click “Next”.

We select the option to repair the system

In this small wizard, the keyboard layout is selected again, as can be seen, not all keyboard layouts fit so more must be shown by clicking “See more keyboard layouts”. When the one you want is found, you must select it to continue.

We select the keyboard layout in the wizard

In the next menu you must click “Troubleshoot” to display the recovery options.

We select the Troubleshooting option

Among the available options you must click “Command Prompt” to launch the CMD console.

We select the Command Prompt option

Once we have the CMD window, we will see that we are on drive “X:” which is a virtual drive. At this point we must access the hard drive where the Windows operating system is installed, that is “c:”. The problem is that at this moment we are operating on a virtual operating system so to access the root of the installed system we must look for the corresponding drive letter; It is most likely “D:”.

To access it, do the following:

Next, the file “sethc.exe” must be copied to another location to have a backup copy, for this we will do: (pay attention to the two dots “..”)

This copies the file to the lower folder, preventing us from deleting it since we will have to recover it when the operation is finished.

The next step is to copy “cmd.exe” and overwrite “sethc.exe” so that later, when we load this program, instead of accessing Sticky Keys, the command line loads and we can make changes in the system.

When making the copy, since we are overwriting a file, it asks us about the operation and we must answer affirmatively with a “yes”.

We copy command to replace sethc

After these changes, we must restart the machine, in any way desired, either with a reboot command, by pressing the power button, etc.

After the restart, on the login screen we must press the Shift key 5 times which will cause a call to “sethc.exe”, but in this case it has been replaced by “cmd.exe”, so CMD will be loaded.

We press the Shift key 5 times

When Windows command (CMD) or command line starts, we can query the user with which it was started by running the command:

And the system will return the message “nt authority\system” that is, a user with the ability to change passwords or create new users, which is basically what we want.

To recover the password, since the previous one cannot be seen (for security reasons, as is logical), we will use a command that allows passwords to be reassigned to existing users or define new users.

Where:

  • <User> : should be “Administrator” for Spanish systems or “Administrator” for English systems.

  • <NewPassword> : The new password that we want to set for this password recovery.

In the case of the example, as can be seen, the command is:

We change the administrator password

Once this is done, you can close or minimize the CMD window to enter the password that we have just assigned.

We enter the password we have assigned

At this point the session will load without problems and you can work normally.

NOTE: As we can see in the image below, the version on which the procedure was done is Windows Server 2025.

At this point you will enter the session and we can see that we are operating normally

For the system to be properly configured the file “sethc.exe” must be put back in place, deleting the “cmd.exe” that we had put in its place to perform this password recovery process.

To make the copy you must use the command “robocopy” from which you can learn more by reading the article we dedicated to it How Windows behaves with File Storage. If we try to do a normal Windows “copy” it will not allow us to copy it due to user privileges.

To make the copy you must type the command as follows:

We restore the original file configuration

A good practice is that after the change, try pressing Shift 5 times to see if it has returned to normal.

We check that the 5-times Shift process has returned to normal

And with this we will have the machine operational again.

Conclusions and next steps:

The process described in this tutorial allows recover the Administrator password in Windows in a simple way. This process is carried out in very few steps, as we have seen in this tutorial.

If you want to see how to do it in GNU/Linux visit this other tutorial:

We hope that with this small guide you won't have problems, but if you do, don't hesitate to contact us so we can give you a hand.

Thank you for your trust!

Last updated

Was this helpful?